diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-08-12 16:45:43 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-08-12 17:00:20 +0200 |
commit | 80825bb43c7a4f188aa060b04513168978c1db0b (patch) | |
tree | 423662d6eedbb195c732643e99f6d5b8a2f6b5c4 | |
parent | fdd75f7ae660441db47733bac200cea4a99ba4fe (diff) |
Fix clippy: Remove needless borrows
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | src/commands/build.rs | 2 | ||||
-rw-r--r-- | src/commands/find_artifact.rs | 2 | ||||
-rw-r--r-- | src/filestore/path.rs | 2 | ||||
-rw-r--r-- | src/job/runnable.rs | 4 | ||||
-rw-r--r-- | src/main.rs | 10 | ||||
-rw-r--r-- | src/orchestrator/orchestrator.rs | 2 | ||||
-rw-r--r-- | src/package/script.rs | 2 | ||||
-rw-r--r-- | src/ui/mod.rs | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/src/commands/build.rs b/src/commands/build.rs index db8d7a4..d0e473b 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -289,7 +289,7 @@ pub async fn build( .collect::<Result<Vec<()>>>()?; trace!("Setting up database jobs for Package, GitHash, Image"); - let db_package = async { Package::create_or_fetch(&database_connection, &package) }; + let db_package = async { Package::create_or_fetch(&database_connection, package) }; let db_githash = async { GitHash::create_or_fetch(&database_connection, &hash_str) }; let db_image = async { Image::create_or_fetch(&database_connection, &image_name) }; let db_envs = async { diff --git a/src/commands/find_artifact.rs b/src/commands/find_artifact.rs index 19e8e2f..0fc9b8c 100644 --- a/src/commands/find_artifact.rs +++ b/src/commands/find_artifact.rs @@ -102,7 +102,7 @@ pub async fn find_artifact(matches: &ArgMatches, config: &Configuration, progres .inspect(|pkg| trace!("Found package: {:?}", pkg)) .map(|pkg| { let script_filter = !matches.is_present("no_script_filter"); - let pathes = crate::db::find_artifacts(database.clone(), config, &pkg, &release_stores, staging_store.as_ref(), &env_filter, script_filter)?; + let pathes = crate::db::find_artifacts(database.clone(), config, pkg, &release_stores, staging_store.as_ref(), &env_filter, script_filter)?; pathes.iter() .map(|tpl| (tpl.0.joined(), tpl.1)) diff --git a/src/filestore/path.rs b/src/filestore/path.rs index 4de941b..6c7558b 100644 --- a/src/filestore/path.rs +++ b/src/filestore/path.rs @@ -48,7 +48,7 @@ impl StoreRoot { let join = self.0.join(&ap.0); if join.is_file() { - Ok(Some(FullArtifactPath(&self, ap))) + Ok(Some(FullArtifactPath(self, ap))) } else if join.is_dir() { Err(anyhow!("Cannot load non-file path: {}", join.display())) } else { diff --git a/src/job/runnable.rs b/src/job/runnable.rs index 22a7d0a..5600273 100644 --- a/src/job/runnable.rs +++ b/src/job/runnable.rs @@ -77,7 +77,7 @@ impl RunnableJob { .inspect(|(name, _)| debug!("Checking: {}", name)) .try_for_each(|(name, _)| { trace!("{:?} contains? {:?}", config.containers().allowed_env(), name); - if !config.containers().allowed_env().contains(&name) { + if !config.containers().allowed_env().contains(name) { Err(anyhow!("Environment variable name not allowed: {}", name)) } else { Ok(()) @@ -127,7 +127,7 @@ impl RunnableJob { } pub fn package_sources(&self) -> Vec<SourceEntry> { - self.source_cache.sources_for(&self.package()) + self.source_cache.sources_for(self.package()) } pub fn environment(&self) -> impl Iterator<Item = (&EnvironmentVariableName, &String)> { diff --git a/src/main.rs b/src/main.rs index 38460a6..18dee07 100644 --- a/src/main.rs +++ b/src/main.rs @@ -143,7 +143,7 @@ async fn main() -> Result<()> { let load_repo = || -> Result<Repository> { let bar = progressbars.bar(); - let repo = Repository::load(&repo_path, &bar) + let repo = Repository::load(repo_path, &bar) .context("Loading the repository")?; bar.finish_with_message("Repository loading finished"); Ok(repo) @@ -159,13 +159,13 @@ async fn main() -> Result<()> { let repo = load_repo()?; crate::commands::build( - &repo_path, + repo_path, matches, progressbars, conn, &config, repo, - &repo_path, + repo_path, ) .await .context("build command failed")? @@ -228,7 +228,7 @@ async fn main() -> Result<()> { Some(("lint", matches)) => { let repo = load_repo()?; - crate::commands::lint(&repo_path, matches, progressbars, &config, repo) + crate::commands::lint(repo_path, matches, progressbars, &config, repo) .await .context("lint command failed")? } @@ -243,7 +243,7 @@ async fn main() -> Result<()> { Some(("metrics", _)) => { let repo = load_repo()?; let conn = db_connection_config.establish_connection(&progressbars)?; - crate::commands::metrics(&repo_path, &config, repo, conn) + crate::commands::metrics(repo_path, &config, repo, conn) .await .context("metrics command failed")? } diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs index 7e2799d..0e548e3 100644 --- a/src/orchestrator/orchestrator.rs +++ b/src/orchestrator/orchestrator.rs @@ -740,7 +740,7 @@ impl<'a> JobTask<'a> { // Create a RunnableJob object let runnable = RunnableJob::build_from_job( - &self.jobdef.job, + self.jobdef.job, self.source_cache, self.config, self.git_author_env, diff --git a/src/package/script.rs b/src/package/script.rs index a0f1527..2b5001a 100644 --- a/src/package/script.rs +++ b/src/package/script.rs @@ -128,7 +128,7 @@ impl<'a> HighlightedScript<'a> { .get(self.script_theme) .ok_or_else(|| anyhow!("Theme not available: {}", self.script_theme))?; - let mut h = HighlightLines::new(syntax, &theme); + let mut h = HighlightLines::new(syntax, theme); Ok({ LinesWithEndings::from(&self.script.0).map(move |line| { diff --git a/src/ui/mod.rs b/src/ui/mod.rs index b0d2167..d016fe8 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -25,7 +25,7 @@ mod package; pub use crate::ui::package::*; pub fn package_repo_cleanness_check(repo: &git2::Repository) -> Result<()> { - if !crate::util::git::repo_is_clean(&repo)? { + if !crate::util::git::repo_is_clean(repo)? { error!( "Repository not clean, refusing to go on: {}", repo.path().display() |