Remove all calls to .clone()

pull/1/head
Elnu 1 year ago
parent 11790783fc
commit 243063826f

@ -22,10 +22,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
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<dyn std::error::Error>> {
let mut drive_temps: Vec<String> = 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<dyn std::error::Error>> {
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,

Loading…
Cancel
Save