Skip to content

Commit abdb759

Browse files
bors[bot]matklad
andauthored
Merge #10207
10207: minor: improve readability r=matklad a=matklad It's important that module interface doesn't depend on features. Better hide features in bodies. bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 9aa71cc + e5b813b commit abdb759

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)