about summary refs log tree commit diff
path: root/tvix/castore
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-27T23·08+0100
committerclbot <clbot@tvl.fyi>2023-12-29T17·18+0000
commit8a52c7f1c54937c44ed1cdb6f7e7c84070828623 (patch)
treee1b073a0cda23cb28f415f4fb55999ec5112286d /tvix/castore
parent5e3683cd530bc0b8831427c715f9cf0c0068d9ec (diff)
feat(tvix/castore/fs): borrow some matches r/7270
We only do things with the reference, so we don't need to locally borrow
it.

Change-Id: I6073f7ec7aff717ae3069e28a00b1cb408a50ceb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10455
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/castore')
-rw-r--r--tvix/castore/src/fs/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tvix/castore/src/fs/mod.rs b/tvix/castore/src/fs/mod.rs
index fd365abf4698..2da072329d34 100644
--- a/tvix/castore/src/fs/mod.rs
+++ b/tvix/castore/src/fs/mod.rs
@@ -235,7 +235,7 @@ where
             // the root node doesn't exist, so the file doesn't exist.
             Ok(None) => Err(io::Error::from_raw_os_error(libc::ENOENT)),
             // The root node does exist
-            Ok(Some(root_node)) => {
+            Ok(Some(ref root_node)) => {
                 // The name must match what's passed in the lookup, otherwise this is also a ENOENT.
                 if root_node.get_name() != name.to_bytes() {
                     debug!(root_node.name=?root_node.get_name(), found_node.name=%name.to_string_lossy(), "node name mismatch");
@@ -258,7 +258,7 @@ where
 
                 // insert the (sparse) inode data and register in
                 // self.root_nodes.
-                let inode_data: InodeData = (&root_node).into();
+                let inode_data: InodeData = root_node.into();
                 let ino = inode_tracker.put(inode_data.clone());
                 root_nodes.insert(name.to_bytes().into(), ino);
 
@@ -391,7 +391,7 @@ where
                     }
                 });
 
-                while let Some((i, root_node)) = rx.blocking_recv() {
+                while let Some((i, ref root_node)) = rx.blocking_recv() {
                     let root_node = match root_node {
                         Err(e) => {
                             warn!("failed to retrieve pathinfo: {}", e);
@@ -405,7 +405,7 @@ where
                     let ino = self.get_inode_for_root_name(name).unwrap_or_else(|| {
                         // insert the (sparse) inode data and register in
                         // self.root_nodes.
-                        let ino = self.inode_tracker.write().put((&root_node).into());
+                        let ino = self.inode_tracker.write().put(root_node.into());
                         self.root_nodes.write().insert(name.into(), ino);
                         ino
                     });