Skip to content

Commit

Permalink
chore: fix warnings on nightly (#558)
Browse files Browse the repository at this point in the history
Signed-off-by: David Barsky <me@davidbarsky.com>
  • Loading branch information
davidbarsky authored Feb 2, 2020
1 parent c889311 commit 3c80984
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
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
7 changes: 0 additions & 7 deletions tracing-subscriber/src/filter/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,6 @@ impl fmt::Display for FromEnvError {
}

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",
}
};
f.pad(msg)
}
}

impl error::Error for Error {}

0 comments on commit 3c80984

Please sign in to comment.