Skip to content

Commit c78b1a4

Browse files
authored
bevy_log: scope print_stderr expectation to the eprintln call (#24191)
# Objective - `cargo clippy -p bevy_log --no-deps -- -D warnings` - print is only used if the trace feature is on ## Solution - scope the expect to the print ## Testing - CI
1 parent c50521c commit c78b1a4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

crates/bevy_log/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,15 @@ impl Default for LogPlugin {
293293
}
294294

295295
impl Plugin for LogPlugin {
296-
#[expect(clippy::print_stderr, reason = "Allowed during logger setup")]
297296
fn build(&self, app: &mut App) {
298297
#[cfg(feature = "trace")]
299298
{
300299
let old_handler = std::panic::take_hook();
301300
std::panic::set_hook(Box::new(move |infos| {
302-
eprintln!("{}", tracing_error::SpanTrace::capture());
301+
#[expect(clippy::print_stderr, reason = "Allowed during logger setup")]
302+
{
303+
eprintln!("{}", tracing_error::SpanTrace::capture());
304+
}
303305
old_handler(infos);
304306
}));
305307
}

0 commit comments

Comments
 (0)