logging: Fix needless_borrow warnings

As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-01-02 13:21:27 +01:00
parent 60df30015b
commit ffd6fbb6b6

View File

@ -168,12 +168,12 @@ impl FileRotator {
#[cfg(test)] #[cfg(test)]
if !self.fail_rename && self.path.exists() { if !self.fail_rename && self.path.exists() {
let rotated_path = self.rotated_path(1); let rotated_path = self.rotated_path(1);
let _ = fs::rename(&self.path, &rotated_path); let _ = fs::rename(&self.path, rotated_path);
} }
#[cfg(not(test))] #[cfg(not(test))]
if self.path.exists() { if self.path.exists() {
let rotated_path = self.rotated_path(1); let rotated_path = self.rotated_path(1);
let _ = fs::rename(&self.path, &rotated_path); let _ = fs::rename(&self.path, rotated_path);
} }
let delete_path = self.rotated_path(self.rotate_keep + 1); let delete_path = self.rotated_path(self.rotate_keep + 1);