Skip to content

Commit e5b813b

Browse files
committed
minor: improve readability
It's important that module interface doesn't depend on features. Better hide features in bodies.
1 parent 07fb5db commit e5b813b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

crates/stdx/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ pub fn timeit(label: &'static str) -> impl Drop {
1919
}
2020

2121
/// Prints backtrace to stderr, useful for debugging.
22-
#[cfg(feature = "backtrace")]
23-
pub fn print_backtrace() {
24-
let bt = backtrace::Backtrace::new();
25-
eprintln!("{:?}", bt);
26-
}
27-
#[cfg(not(feature = "backtrace"))]
2822
pub fn print_backtrace() {
23+
#[cfg(feature = "backtrace")]
24+
eprintln!("{:?}", backtrace::Backtrace::new());
25+
26+
#[cfg(not(feature = "backtrace"))]
2927
eprintln!(
3028
r#"Enable the backtrace feature.
3129
Uncomment `default = [ "backtrace" ]` in `crates/stdx/Cargo.toml`.

0 commit comments

Comments
 (0)