Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tracing-attributes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
unused_parens,
while_true
)]
// TODO: once `tracing` bumps its MSRV to 1.42, remove this allow.
#![allow(unused)]
extern crate proc_macro;

use std::collections::HashSet;
Expand Down
11 changes: 2 additions & 9 deletions tracing-subscriber/src/filter/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,20 +406,13 @@ impl From<env::VarError> for FromEnvError {
impl fmt::Display for FromEnvError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.kind {
ErrorKind::Parse(ref p) => p.fmt(f),
ErrorKind::Env(ref e) => e.fmt(f),
ErrorKind::Parse(ref p) => write!(f, "{}", p.to_string()),
ErrorKind::Env(ref e) => write!(f, "{}", e.to_string()),
}
}
}

impl Error for FromEnvError {
fn description(&self) -> &str {
match self.kind {
ErrorKind::Parse(ref p) => p.description(),
ErrorKind::Env(ref e) => e.description(),
}
}

fn source(&self) -> Option<&(dyn Error + 'static)> {
match self.kind {
ErrorKind::Parse(ref p) => Some(p),
Expand Down
13 changes: 5 additions & 8 deletions tracing-subscriber/src/reload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,12 @@ impl Error {

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
error::Error::description(self).fmt(f)
}
}

impl error::Error for Error {
fn description(&self) -> &str {
match self.kind {
let msg = match self.kind {
ErrorKind::SubscriberGone => "subscriber no longer exists",
ErrorKind::Poisoned => "lock poisoned",
}
};
write!(f, "{}", msg)
}
}

impl error::Error for Error {}