Skip to content

Commit

Permalink
Apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
colelawrence committed Sep 17, 2020
1 parent 5b57fb0 commit f2099cf
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use core::fmt::{self, Write};
use core::sync::atomic::AtomicUsize;

use tracing;
use tracing::field::{Field, Visit};
use tracing::Subscriber;
use tracing_subscriber;
use tracing_subscriber::layer::*;
use tracing_subscriber::registry::*;

Expand Down Expand Up @@ -113,12 +111,12 @@ impl<S: Subscriber + for<'a> LookupSpan<'a>> Layer<S> for WASMLayer {
if self.config.use_console_color {
log4(
&format!("%c{}%c {}%c{}", level, origin, recorder),
match level {
&tracing::Level::TRACE => "color: dodgerblue; background: #444",
&tracing::Level::DEBUG => "color: lawngreen; background: #444",
&tracing::Level::INFO => "color: whitesmoke; background: #444",
&tracing::Level::WARN => "color: orange; background: #444",
&tracing::Level::ERROR => "color: red; background: #444",
match *level {
tracing::Level::TRACE => "color: dodgerblue; background: #444",
tracing::Level::DEBUG => "color: lawngreen; background: #444",
tracing::Level::INFO => "color: whitesmoke; background: #444",
tracing::Level::WARN => "color: orange; background: #444",
tracing::Level::ERROR => "color: red; background: #444",
},
"color: gray; font-style: italic",
"color: inherit",
Expand Down Expand Up @@ -217,7 +215,7 @@ impl Visit for StringRecorder {
} else {
if self.1 {
// following args
write!(self.0, "\n").unwrap();
writeln!(self.0, "").unwrap();
} else {
// first arg
write!(self.0, " ").unwrap();
Expand Down

0 comments on commit f2099cf

Please sign in to comment.