Fix borrow issue
All checks were successful
Basic Cargo Checks / docker-build (push) Successful in 48s
Basic Cargo Checks / docker-check (push) Successful in 2m32s

This commit is contained in:
Blizzard Finnegan 2023-06-12 08:45:47 -04:00
parent 40c33a8d79
commit b0dad705bc
Signed by: blizzardfinnegan
GPG key ID: 61C1E13067E0018E

View file

@ -39,7 +39,7 @@ impl Device{
log::debug!("{:?}",&self.serial); log::debug!("{:?}",&self.serial);
let output_path = OUTPUT_FOLDER.to_owned() + &self.serial + ".txt"; let output_path = OUTPUT_FOLDER.to_owned() + &self.serial + ".txt";
if ! Path::new(&output_path).exists(){ if ! Path::new(&output_path).exists(){
log::debug!("Creating file {}",output_path); log::debug!("Creating file {}",&output_path);
let temp = fs::File::create(&output_path); let temp = fs::File::create(&output_path);
match temp{ match temp{
Ok(file) => { Ok(file) => {
@ -242,11 +242,11 @@ impl Device{
} }
fn save_values(&mut self) -> bool{ fn save_values(&mut self) -> bool{
let output_path = OUTPUT_FOLDER.to_owned() + &self.serial + ".txt"; let output_path = OUTPUT_FOLDER.to_owned() + &self.serial + ".txt";
let temp = fs::OpenOptions::new().write(true).truncate(true).open(output_path); let temp = fs::OpenOptions::new().write(true).truncate(true).open(&output_path);
match temp{ match temp{
Ok(opened_file) => self.output_file = Some(opened_file), Ok(opened_file) => self.output_file = Some(opened_file),
Err(_) => { Err(_) => {
log::warn!("Could not open file [{}] to write! Potential permissions error.",output_path); log::warn!("Could not open file [{}] to write! Potential permissions error.",&output_path);
return false return false
} }
} }