From 840b597423a2c41e266c2b05275d43c35ab3d652 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 27 Sep 2021 15:18:56 +0300 Subject: Simplify how to create a vector of cloned values Instead of this: something.iter().cloned().collect() do this: something.to_vec() It's shorter, simpler, and more to the point, and thus easier to understand. Found by clippy lint iter_cloned_collect: https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect --- ipc/src/sexp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ipc') diff --git a/ipc/src/sexp.rs b/ipc/src/sexp.rs index 2290b615..a362232b 100644 --- a/ipc/src/sexp.rs +++ b/ipc/src/sexp.rs @@ -245,7 +245,7 @@ impl Sexp { Sexp::List(ref ll) => match ll.get(0) { Some(Sexp::String(ref tag)) => if tag.deref() == key { - Ok(Some(ll[1..].iter().cloned().collect())) + Ok(Some(ll[1..].to_vec())) } else { Ok(None) } -- cgit v1.2.3