diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-27 15:18:56 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-30 08:31:10 +0300 |
commit | 840b597423a2c41e266c2b05275d43c35ab3d652 (patch) | |
tree | 7c90d2d471a587a04386001e2a65108d1f3cf963 /ipc | |
parent | 21aa0ec2cd79a8e5e7268597733526e8d2e64feb (diff) |
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
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/src/sexp.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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) } |