Remove all calls to .clone()

This commit is contained in:
Elnu 2023-08-26 11:54:28 -07:00
parent 11790783fc
commit 243063826f

View file

@ -22,10 +22,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
debug!("Opening Config file: {}", args.config_file); debug!("Opening Config file: {}", args.config_file);
debug!( debug!(
"Config file exists: {}", "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, Ok(val) => val,
Err(e) => { Err(e) => {
error!("Could not read config file: {}", e.to_string()); error!("Could not read config file: {}", e.to_string());
@ -67,9 +67,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut drive_temps: Vec<String> = vec![]; let mut drive_temps: Vec<String> = vec![];
for drive in drives { 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("--unit=F")
.arg(drive.clone()) .arg(&drive)
.output() .output()
{ {
Ok(val) => String::from_utf8_lossy(&val.stdout).into_owned(), Ok(val) => String::from_utf8_lossy(&val.stdout).into_owned(),
@ -93,12 +93,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
Client::new() Client::new()
.put(format!( .put(format!(
"https://{}/index.php/apps/notes/api/v1/notes/{}", "https://{}/index.php/apps/notes/api/v1/notes/{}",
cfg.server_url.clone(), &cfg.server_url,
cfg.note_id.clone() &cfg.note_id
)) ))
.header("Accept", "application/json") .header("Accept", "application/json")
.header("Content-Type", "application/json") .header("Content-Type", "application/json")
.basic_auth(cfg.user.clone(), Some(cfg.pswd.clone())) .basic_auth(&cfg.user, Some(&cfg.pswd))
.body( .body(
serde_json::to_string(&NoteUpdate { serde_json::to_string(&NoteUpdate {
content: body_content, content: body_content,