From cb8466d41791c02a20815ac321b9dceb347fbdc4 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 15 Feb 2023 16:46:03 +0200 Subject: refactor(tvix/store/proto): use .cloned() Instead of using an explicit closure to clone elements, use .cloned(). Change-Id: I31f0f0bad2b4935e1a8d91fa0d14163c94182e1b Reviewed-on: https://cl.tvl.fyi/c/depot/+/8109 Autosubmit: flokli Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/store/src/proto.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tvix/store/src/proto.rs b/tvix/store/src/proto.rs index a01f09fa8fd2..0ca3af321c86 100644 --- a/tvix/store/src/proto.rs +++ b/tvix/store/src/proto.rs @@ -333,23 +333,17 @@ impl Iterator for DirectoryNodesIterator<'_> { if left_name_lt_right(self.i_directories.peek(), self.i_symlinks.peek()) { self.i_directories .next() - .map(|x| x.clone()) + .cloned() .map(node::Node::Directory) } else { - self.i_symlinks - .next() - .map(|x| x.clone()) - .map(node::Node::Symlink) + self.i_symlinks.next().cloned().map(node::Node::Symlink) } } else { // i_files is still in the game, compare with symlinks if left_name_lt_right(self.i_files.peek(), self.i_symlinks.peek()) { - self.i_files.next().map(|x| x.clone()).map(node::Node::File) + self.i_files.next().cloned().map(node::Node::File) } else { - self.i_symlinks - .next() - .map(|x| x.clone()) - .map(node::Node::Symlink) + self.i_symlinks.next().cloned().map(node::Node::Symlink) } } } -- cgit 1.4.1