Skip to content

Commit

Permalink
fix the used warning
Browse files Browse the repository at this point in the history
  • Loading branch information
huangjj27 committed Jan 16, 2021
1 parent d2f97c3 commit 61af00e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/fmt/writer/termcolor/extern_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,21 @@ impl BufferWriter {
// This is so their output can be captured by `cargo test`
let log = String::from_utf8_lossy(buf.bytes());

#[cfg(all(target_arch = "wasm32", target_vendor = "unknown"))]
wasm::print(&log, self.target);

#[cfg(not(all(target_arch = "wasm32", target_vendor = "unknown")))]
match target {
Target::Stderr => eprint!("{}", log),
Target::Stdout => print!("{}", log),
}

Ok(())
} else {
#[cfg(all(target_arch = "wasm32", target_vendor = "unknown"))]
wasm::print(&log, self.target);

#[cfg(not(all(target_arch = "wasm32", target_vendor = "unknown")))]
self.inner.print(&buf.inner)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@
html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://www.rust-lang.org/static/images/favicon.ico"
)]
// #![cfg_attr(test, deny(warnings))]
#![cfg_attr(test, deny(warnings))]
// When compiled for the rustc compiler itself we want to make sure that this is
// an unstable crate
#![cfg_attr(rustbuild, feature(staged_api, rustc_private))]
#![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))]
// #![deny(missing_debug_implementations, missing_docs, warnings)]
#![deny(missing_debug_implementations, missing_docs, warnings)]

use std::{borrow::Cow, cell::RefCell, env, io};

Expand Down
1 change: 0 additions & 1 deletion tests/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use env_logger::Env;
use log::{debug, error, info, trace, warn};

#[cfg(all(target_arch = "wasm32", target_vendor = "unknown"))]
use wasm_bindgen_test::*;

#[wasm_bindgen_test]
Expand Down
1 change: 0 additions & 1 deletion tests/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use env_logger::Env;
use log::{debug, error, info, trace, warn};

#[cfg(all(target_arch = "wasm32", target_vendor = "unknown"))]
use wasm_bindgen_test::*;

wasm_bindgen_test_configure!(run_in_browser);
Expand Down

0 comments on commit 61af00e

Please sign in to comment.