From 243063826f9a84b7119c4667bd94172b34b8b4bf Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 26 Aug 2023 11:54:28 -0700 Subject: [PATCH] Remove all calls to .clone() --- status_cloud/src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/status_cloud/src/main.rs b/status_cloud/src/main.rs index 37b92f2..dea5526 100644 --- a/status_cloud/src/main.rs +++ b/status_cloud/src/main.rs @@ -22,10 +22,10 @@ fn main() -> Result<(), Box> { debug!("Opening Config file: {}", args.config_file); debug!( "Config file exists: {}", - std::fs::metadata(args.config_file.clone()).is_ok() + std::fs::metadata(&args.config_file).is_ok() ); - let file_contents = match std::fs::read_to_string(args.config_file) { + let file_contents = match std::fs::read_to_string(&args.config_file) { Ok(val) => val, Err(e) => { error!("Could not read config file: {}", e.to_string()); @@ -67,9 +67,9 @@ fn main() -> Result<(), Box> { let mut drive_temps: Vec = vec![]; for drive in drives { - let output = match Command::new(args.hddtemp_executable.clone()) + let output = match Command::new(&args.hddtemp_executable) .arg("--unit=F") - .arg(drive.clone()) + .arg(&drive) .output() { Ok(val) => String::from_utf8_lossy(&val.stdout).into_owned(), @@ -93,12 +93,12 @@ fn main() -> Result<(), Box> { Client::new() .put(format!( "https://{}/index.php/apps/notes/api/v1/notes/{}", - cfg.server_url.clone(), - cfg.note_id.clone() + &cfg.server_url, + &cfg.note_id )) .header("Accept", "application/json") .header("Content-Type", "application/json") - .basic_auth(cfg.user.clone(), Some(cfg.pswd.clone())) + .basic_auth(&cfg.user, Some(&cfg.pswd)) .body( serde_json::to_string(&NoteUpdate { content: body_content,