Skip to content

Commit

Permalink
Eliminate some needlessly cfg'd Backtrace imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 20, 2021
1 parent 1631007 commit fea4d8a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub(crate) enum Backtrace {}
#[cfg(backtrace)]
macro_rules! backtrace {
() => {
Some(Backtrace::capture())
Some(crate::backtrace::Backtrace::capture())
};
}

Expand All @@ -23,7 +23,7 @@ macro_rules! backtrace_if_absent {
($err:expr) => {
match $err.backtrace() {
Some(_) => None,
None => Some(Backtrace::capture()),
None => backtrace!(),
}
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ use core::fmt::{Debug, Display};
#[cfg(feature = "std")]
use crate::StdError;

#[cfg(backtrace)]
use std::backtrace::Backtrace;

pub struct Adhoc;

pub trait AdhocKind: Sized {
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,6 @@ pub mod private {
use crate::Error;
use core::fmt::{Debug, Display};

#[cfg(backtrace)]
use std::backtrace::Backtrace;

pub use core::result::Result::Err;

#[doc(hidden)]
Expand Down

0 comments on commit fea4d8a

Please sign in to comment.