From fcfbcf9cfa52e221056ea52f7b70e06ca0a36eba Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 25 May 2023 08:29:03 +0300 Subject: refactor(tvix/store): drop mut self borrow in ingest_path With traverse_to not requiring a &mut anymore, we can drop the &mut self in all these function signatures. Change-Id: I22105376b625cb281c39e92d3206df8a6ce97a88 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8629 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: flokli --- tvix/store/src/import.rs | 6 +++--- tvix/store/src/store_io.rs | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'tvix/store/src') diff --git a/tvix/store/src/import.rs b/tvix/store/src/import.rs index ade700a6c283..206e5eaba975 100644 --- a/tvix/store/src/import.rs +++ b/tvix/store/src/import.rs @@ -56,7 +56,7 @@ impl From for Error { // It assumes the caller adds returned nodes to the directories it assembles. #[instrument(skip_all, fields(entry.file_type=?&entry.file_type(),entry.path=?entry.path()))] fn process_entry( - blob_service: &mut BS, + blob_service: &BS, directory_putter: &mut DP, entry: &walkdir::DirEntry, maybe_directory: Option, @@ -145,8 +145,8 @@ fn process_entry( /// naming scheme. #[instrument(skip(blob_service, directory_service), fields(path=?p))] pub fn ingest_path + Debug>( - blob_service: &mut BS, - directory_service: &mut DS, + blob_service: &BS, + directory_service: &DS, p: P, ) -> Result { // Probe if the path points to a symlink. If it does, we process it manually, diff --git a/tvix/store/src/store_io.rs b/tvix/store/src/store_io.rs index e4c45f9e5952..a7467362d334 100644 --- a/tvix/store/src/store_io.rs +++ b/tvix/store/src/store_io.rs @@ -96,7 +96,7 @@ impl Result { // Call [import::ingest_path], which will walk over the given path and return a root_node. - let root_node = - import::ingest_path(&mut self.blob_service, &mut self.directory_service, path) - .expect("error during import_path"); + let root_node = import::ingest_path(&self.blob_service, &self.directory_service, path) + .expect("error during import_path"); // Render the NAR let (nar_size, nar_sha256) = self -- cgit 1.4.1