From d7dff14df9f515715c4ec5d47ad172f820692a10 Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Fri, 2 Aug 2024 12:04:04 +0200 Subject: [PATCH] clippy --- cargo-shuttle/src/lib.rs | 4 ++-- cargo-shuttle/src/provisioner_server.rs | 2 +- gateway/src/project.rs | 4 ++-- resource-recorder/tests/integration.rs | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cargo-shuttle/src/lib.rs b/cargo-shuttle/src/lib.rs index 1c973e3f5..ef68f4f1b 100644 --- a/cargo-shuttle/src/lib.rs +++ b/cargo-shuttle/src/lib.rs @@ -641,7 +641,7 @@ impl Shuttle { if should_create_environment { // Set the project working directory path to the init path, // so `load_project` is ran with the correct project path - project_args.working_directory = path.clone(); + project_args.working_directory.clone_from(&path); self.load_project(&project_args)?; self.project_start(DEFAULT_IDLE_MINUTES).await?; @@ -1881,7 +1881,7 @@ impl Shuttle { dunce::canonicalize(runtime_executable).context("canonicalize path of executable")?, ) .current_dir(&service.workspace_path) - .args(&["--run"]) + .args(["--run"]) .envs([ ("SHUTTLE_BETA", "true"), ("SHUTTLE_PROJECT_ID", "proj_LOCAL"), diff --git a/cargo-shuttle/src/provisioner_server.rs b/cargo-shuttle/src/provisioner_server.rs index fd0f8193a..407ac1746 100644 --- a/cargo-shuttle/src/provisioner_server.rs +++ b/cargo-shuttle/src/provisioner_server.rs @@ -589,7 +589,7 @@ pub mod beta { .await .context("Failed to start Docker container. Make sure that a Docker engine is running.")?; ShuttleResourceOutput { - output: serde_json::to_value(&res).unwrap(), + output: serde_json::to_value(res).unwrap(), custom: serde_json::Value::Null, state: Some(resource::ResourceState::Ready), } diff --git a/gateway/src/project.rs b/gateway/src/project.rs index b553e5310..85d61f4ca 100644 --- a/gateway/src/project.rs +++ b/gateway/src/project.rs @@ -732,7 +732,7 @@ pub async fn refresh_with_retry( let mut proj = Box::new(project); loop { - let refreshed = proj.refresh(ctx).await; + let refreshed = proj.clone().refresh(ctx).await; match refreshed.as_ref() { Ok(Project::Errored(err)) => match &err.ctx { Some(err_ctx) => { @@ -740,7 +740,7 @@ pub async fn refresh_with_retry( return refreshed; } else { num_attempt += 1; - proj = err_ctx.clone(); + proj.clone_from(err_ctx); tokio::time::sleep(Duration::from_millis(100_u64 * 2_u64.pow(num_attempt))) .await } diff --git a/resource-recorder/tests/integration.rs b/resource-recorder/tests/integration.rs index dc201a32e..94cea2515 100644 --- a/resource-recorder/tests/integration.rs +++ b/resource-recorder/tests/integration.rs @@ -258,7 +258,9 @@ async fn manage_resources() { "should update last_updated" ); - service_db.last_updated = response.resources[1].last_updated.clone(); + service_db + .last_updated + .clone_from(&response.resources[1].last_updated); let expected = ResourcesResponse { success: true,