From 362e4a40b22731a67aacfacc46cc67782ae50412 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Mon, 2 Dec 2024 22:00:17 +0100 Subject: [PATCH] Remove needless lifetimes to fix Clippy warnings I already removed some needless lifetimes in 463111e but the needless_lifetimes lint [0] got improved again in Clippy version 0.1.84 (0f13036040 2024-11-30) so this commit drops additional lifetime annotations which can be removed by relying on lifetime elision. This fixes our optional CI Clippy check with the beta toolchain. [0]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes Signed-off-by: Michael Weiss --- src/endpoint/configured.rs | 21 ++++++--------------- src/endpoint/scheduler.rs | 2 +- src/orchestrator/orchestrator.rs | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/endpoint/configured.rs b/src/endpoint/configured.rs index 71330f27..1d91e904 100644 --- a/src/endpoint/configured.rs +++ b/src/endpoint/configured.rs @@ -543,10 +543,7 @@ impl<'a> PreparedContainer<'a> { Ok(create_info) } - async fn copy_source_to_container<'ca>( - container: &Container<'ca>, - job: &RunnableJob, - ) -> Result<()> { + async fn copy_source_to_container(container: &Container<'_>, job: &RunnableJob) -> Result<()> { use tokio::io::AsyncReadExt; job.package_sources() @@ -614,10 +611,7 @@ impl<'a> PreparedContainer<'a> { .map_err(Error::from) } - async fn copy_patches_to_container<'ca>( - container: &Container<'ca>, - job: &RunnableJob, - ) -> Result<()> { + async fn copy_patches_to_container(container: &Container<'_>, job: &RunnableJob) -> Result<()> { use tokio::io::AsyncReadExt; debug!( @@ -672,8 +666,8 @@ impl<'a> PreparedContainer<'a> { .map_err(Error::from) } - async fn copy_artifacts_to_container<'ca>( - container: &Container<'ca>, + async fn copy_artifacts_to_container( + container: &Container<'_>, job: &RunnableJob, staging_store: Arc>, release_stores: &[Arc], @@ -777,10 +771,7 @@ impl<'a> PreparedContainer<'a> { .map(|_| ()) } - async fn copy_script_to_container<'ca>( - container: &Container<'ca>, - script: &Script, - ) -> Result<()> { + async fn copy_script_to_container(container: &Container<'_>, script: &Script) -> Result<()> { let script_path = PathBuf::from(crate::consts::SCRIPT_PATH); container .copy_file_into(script_path, script.as_ref().as_bytes()) @@ -932,7 +923,7 @@ pub struct ExecutedContainer<'a> { exit_info: Option<(bool, Option)>, } -impl<'a> ExecutedContainer<'a> { +impl ExecutedContainer<'_> { pub fn container_hash(&self) -> ContainerHash { ContainerHash::from(self.create_info.id.clone()) } diff --git a/src/endpoint/scheduler.rs b/src/endpoint/scheduler.rs index 570eb410..74caaac4 100644 --- a/src/endpoint/scheduler.rs +++ b/src/endpoint/scheduler.rs @@ -382,7 +382,7 @@ struct LogReceiver<'a> { bar: ProgressBar, } -impl<'a> LogReceiver<'a> { +impl LogReceiver<'_> { async fn join(mut self) -> Result { let mut success = None; // Reserve a reasonable amount of elements. diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs index 4e4690a9..b4e0f1dc 100644 --- a/src/orchestrator/orchestrator.rs +++ b/src/orchestrator/orchestrator.rs @@ -263,7 +263,7 @@ impl Borrow for ProducedArtifact { } } -impl<'a> Orchestrator<'a> { +impl Orchestrator<'_> { pub async fn run(self, output: &mut Vec) -> Result> { let (results, errors) = self.run_tree().await?; output.extend(results);