diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-03-04 13:34:13 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-03-04 13:34:54 +0100 |
commit | 5b46db841f74663c896c37e5f40a4ad08699ba2b (patch) | |
tree | 7eb3b4875b90d33c834efcc206ddb5952d93f915 /src/commands | |
parent | e83155b64527de035b55d57c12c96463f0443b84 (diff) |
Do not pass progress bars by value, but by reference
Because passing by value is simply not necessary here.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/build.rs | 6 | ||||
-rw-r--r-- | src/commands/find_artifact.rs | 4 | ||||
-rw-r--r-- | src/commands/tree_of.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/commands/build.rs b/src/commands/build.rs index 85697d6..421f7ee 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -163,7 +163,7 @@ pub async fn build( let p = config.releases_directory().join(storename); debug!("Loading release directory: {}", p.display()); - let r = ReleaseStore::load(StoreRoot::new(p)?, bar_release_loading.clone()); + let r = ReleaseStore::load(StoreRoot::new(p)?, &bar_release_loading); if r.is_ok() { bar_release_loading.finish_with_message("Loaded releases successfully"); } else { @@ -208,7 +208,7 @@ pub async fn build( } debug!("Loading staging directory: {}", p.display()); - let r = StagingStore::load(StoreRoot::new(p.clone())?, bar_staging_loading.clone()); + let r = StagingStore::load(StoreRoot::new(p.clone())?, &bar_staging_loading); if r.is_ok() { bar_staging_loading.finish_with_message("Loaded staging successfully"); } else { @@ -220,7 +220,7 @@ pub async fn build( let dag = { let bar_tree_building = progressbars.bar(); bar_tree_building.set_length(max_packages); - let dag = Dag::for_root_package(package.clone(), &repo, bar_tree_building.clone())?; + let dag = Dag::for_root_package(package.clone(), &repo, &bar_tree_building)?; bar_tree_building.finish_with_message("Finished loading Dag"); dag }; diff --git a/src/commands/find_artifact.rs b/src/commands/find_artifact.rs index 93b332b..469fb6e 100644 --- a/src/commands/find_artifact.rs +++ b/src/commands/find_artifact.rs @@ -59,7 +59,7 @@ pub async fn find_artifact(matches: &ArgMatches, config: &Configuration, progres let p = config.releases_directory().join(storename); debug!("Loading release directory: {}", p.display()); - let r = ReleaseStore::load(StoreRoot::new(p)?, bar_release_loading.clone()); + let r = ReleaseStore::load(StoreRoot::new(p)?, &bar_release_loading); if r.is_ok() { bar_release_loading.finish_with_message("Loaded releases successfully"); } else { @@ -79,7 +79,7 @@ pub async fn find_artifact(matches: &ArgMatches, config: &Configuration, progres } debug!("Loading staging directory: {}", p.display()); - let r = StagingStore::load(StoreRoot::new(p.clone())?, bar_staging_loading.clone()); + let r = StagingStore::load(StoreRoot::new(p.clone())?, &bar_staging_loading); if r.is_ok() { bar_staging_loading.finish_with_message("Loaded staging successfully"); } else { diff --git a/src/commands/tree_of.rs b/src/commands/tree_of.rs index df3a6cf..30196b7 100644 --- a/src/commands/tree_of.rs +++ b/src/commands/tree_of.rs @@ -45,7 +45,7 @@ pub async fn tree_of( }) .map(|package| { let bar_tree_building = progressbars.bar(); - let tree = Dag::for_root_package(package.clone(), &repo, bar_tree_building.clone())?; + let tree = Dag::for_root_package(package.clone(), &repo, &bar_tree_building)?; bar_tree_building.finish_with_message("Finished loading Tree"); Ok(tree) }) |