about summary refs log tree commit diff
path: root/tvix/store/src/proto.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-02-15T14·46+0200
committerclbot <clbot@tvl.fyi>2023-02-15T18·40+0000
commitcb8466d41791c02a20815ac321b9dceb347fbdc4 (patch)
tree08ade5270bc4e0c15915126c8b16b9c36209f3b9 /tvix/store/src/proto.rs
parentcfa0755fc41cb643d172bda024d02e172b3f5923 (diff)
refactor(tvix/store/proto): use .cloned() r/5853
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 <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/store/src/proto.rs')
-rw-r--r--tvix/store/src/proto.rs14
1 files 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)
             }
         }
     }