mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 12:25:05 +00:00
minor: improve readability
It's important that module interface doesn't depend on features. Better hide features in bodies.
This commit is contained in:
parent
07fb5db3dc
commit
e5b813b566
1 changed files with 4 additions and 6 deletions
|
@ -19,13 +19,11 @@ pub fn timeit(label: &'static str) -> impl Drop {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Prints backtrace to stderr, useful for debugging.
|
/// Prints backtrace to stderr, useful for debugging.
|
||||||
#[cfg(feature = "backtrace")]
|
|
||||||
pub fn print_backtrace() {
|
|
||||||
let bt = backtrace::Backtrace::new();
|
|
||||||
eprintln!("{:?}", bt);
|
|
||||||
}
|
|
||||||
#[cfg(not(feature = "backtrace"))]
|
|
||||||
pub fn print_backtrace() {
|
pub fn print_backtrace() {
|
||||||
|
#[cfg(feature = "backtrace")]
|
||||||
|
eprintln!("{:?}", backtrace::Backtrace::new());
|
||||||
|
|
||||||
|
#[cfg(not(feature = "backtrace"))]
|
||||||
eprintln!(
|
eprintln!(
|
||||||
r#"Enable the backtrace feature.
|
r#"Enable the backtrace feature.
|
||||||
Uncomment `default = [ "backtrace" ]` in `crates/stdx/Cargo.toml`.
|
Uncomment `default = [ "backtrace" ]` in `crates/stdx/Cargo.toml`.
|
||||||
|
|
Loading…
Reference in a new issue