Skip to content

Commit

Permalink
clippy dings
Browse files Browse the repository at this point in the history
Signed-off-by: Brian L. Troutwine <[email protected]>
  • Loading branch information
blt committed Nov 2, 2023
1 parent 9f3d917 commit 6dc7bf9
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lading/src/generator/file_gen/logrotate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//!
use std::{
num::{NonZeroU32, NonZeroUsize},
path::PathBuf,
path::{Path, PathBuf},
str, thread,
};

Expand Down Expand Up @@ -175,7 +175,7 @@ impl Server {
basename.set_extension("log");

let child = Child::new(
basename,
&basename,
config.total_rotations,
bytes_per_second,
maximum_bytes_per_file,
Expand Down Expand Up @@ -229,7 +229,7 @@ struct Child {

impl Child {
fn new(
basename: PathBuf,
basename: &Path,
total_rotations: u8,
bytes_per_second: NonZeroU32,
maximum_bytes_per_log: NonZeroU32,
Expand All @@ -241,13 +241,10 @@ impl Child {
for i in 0..total_rotations {
let name = format!(
"{orig}.{i}",
orig = basename
.file_name()
.unwrap_or_default()
.to_string_lossy()
.to_string()
orig = basename.file_name().unwrap_or_default().to_string_lossy()
);
let mut pth = basename.clone();
let mut pth = PathBuf::new();
pth.push(basename);
pth.set_file_name(name);
names.push(pth);
}
Expand Down

0 comments on commit 6dc7bf9

Please sign in to comment.