Auto-fix clippy::collapsible_if violations (#36428)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 15:27:24 +02:00 committed by GitHub
parent 9e8ec72bd5
commit 8f567383e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
281 changed files with 6628 additions and 7089 deletions

View file

@ -194,10 +194,10 @@ pub fn flush() {
ENABLED_SINKS_FILE.clear_poison();
handle.into_inner()
});
if let Some(file) = file.as_mut() {
if let Err(err) = file.flush() {
eprintln!("Failed to flush log file: {}", err);
}
if let Some(file) = file.as_mut()
&& let Err(err) = file.flush()
{
eprintln!("Failed to flush log file: {}", err);
}
}

View file

@ -28,10 +28,8 @@ pub fn try_init() -> anyhow::Result<()> {
}
pub fn init_test() {
if get_env_config().is_some() {
if try_init().is_ok() {
init_output_stdout();
}
if get_env_config().is_some() && try_init().is_ok() {
init_output_stdout();
}
}
@ -344,18 +342,18 @@ impl Timer {
return;
}
let elapsed = self.start_time.elapsed();
if let Some(warn_limit) = self.warn_if_longer_than {
if elapsed > warn_limit {
crate::warn!(
self.logger =>
"Timer '{}' took {:?}. Which was longer than the expected limit of {:?}",
self.name,
elapsed,
warn_limit
);
self.done = true;
return;
}
if let Some(warn_limit) = self.warn_if_longer_than
&& elapsed > warn_limit
{
crate::warn!(
self.logger =>
"Timer '{}' took {:?}. Which was longer than the expected limit of {:?}",
self.name,
elapsed,
warn_limit
);
self.done = true;
return;
}
crate::trace!(
self.logger =>