Skip to content

Commit

Permalink
Fix new clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
emabee committed Aug 25, 2024
1 parent dcb1717 commit a13c0dc
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions src/writers/file_log_writer/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,28 +425,21 @@ impl State {
if force || rotation_state.roll_state.rotation_necessary() {
let infix = match rotation_state.naming_state {
NamingState::Timestamps(ref mut ts, ref o_current_infix, ref fmt) => {
match o_current_infix {
Some(current_infix) => {
*ts = rcurrents_creation_timestamp(
&self.config,
current_infix,
true,
Some(ts),
fmt,
)?;
current_infix.clone()
}
None => {
*ts = Local::now();
collision_free_infix_for_rotated_file(
&self.config.file_spec,
&infix_from_timestamp(
ts,
self.config.use_utc,
&InfixFormat::Std,
),
)
}
if let Some(current_infix) = o_current_infix {
*ts = rcurrents_creation_timestamp(
&self.config,
current_infix,
true,
Some(ts),
fmt,
)?;
current_infix.clone()
} else {
*ts = Local::now();
collision_free_infix_for_rotated_file(
&self.config.file_spec,
&infix_from_timestamp(ts, self.config.use_utc, &InfixFormat::Std),
)
}
}
NamingState::NumbersRCurrent(ref mut idx_state) => {
Expand Down

0 comments on commit a13c0dc

Please sign in to comment.