From 63ffdcd46785a5e426dcccb9c26e9f6cba84527e Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Fri, 10 Nov 2023 11:09:44 +0000 Subject: [PATCH] node: loosen BoundedVec::collect_from bounds The bounds on `collect_from` were overly restrictive. Allow any `IntoIterator` be used as an argument, while taking ownership, rather mutably borrowed. Signed-off-by: Fintan Halpenny X-Clacks-Overhead: GNU Terry Pratchett --- radicle-node/src/bounded.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radicle-node/src/bounded.rs b/radicle-node/src/bounded.rs index aea59730..15e0d47a 100644 --- a/radicle-node/src/bounded.rs +++ b/radicle-node/src/bounded.rs @@ -33,7 +33,7 @@ impl BoundedVec { /// assert_eq!(bounded.len(), 3); /// assert_eq!(iter.count(), 1); /// ``` - pub fn collect_from>(iter: &mut I) -> Self { + pub fn collect_from>(iter: I) -> Self { BoundedVec { v: iter.into_iter().take(N).collect(), }