From 8a52c7f1c54937c44ed1cdb6f7e7c84070828623 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 28 Dec 2023 00:08:07 +0100 Subject: feat(tvix/castore/fs): borrow some matches 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 Reviewed-by: raitobezarius --- tvix/castore/src/fs/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tvix') 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 }); -- cgit 1.4.1