fix(lint): re-enable clippy, fix lints

master
Ashley Williams 6 years ago
parent d6baf439b7
commit b96538ec23
  1. 2
      .travis.yml
  2. 2
      src/command/test.rs
  3. 8
      src/main.rs
  4. 8
      src/manifest/mod.rs

@ -51,7 +51,7 @@ matrix:
- rustup component add rustfmt-preview
- cargo fmt --version
- cargo fmt --all -- --check
# - rustup component add clippy-preview
- rustup component add clippy-preview
# - cargo clippy --version
# - cargo clippy

@ -382,6 +382,6 @@ impl Test {
if !self.headless {
envs.push(("NO_HEADLESS", "1"));
}
return envs;
envs
}
}

@ -64,8 +64,7 @@ fn run() -> Result<(), failure::Error> {
// If we're actually running as the installer then execute our
// self-installation, otherwise just continue as usual.
if me
.file_stem()
.and_then(|s| s.to_str())
.file_stem().and_then(|s| s.to_str())
.expect("executable should have a filename")
.starts_with("wasm-pack-init")
{
@ -94,8 +93,7 @@ fn setup_panic_hooks() {
let default_hook = panic::take_hook();
match env::var("RUST_BACKTRACE") {
Err(_) => {
if let Err(_) = env::var("RUST_BACKTRACE") {
panic::set_hook(Box::new(move |info: &panic::PanicInfo| {
// First call the default hook that prints to standard error.
default_hook(info);
@ -106,6 +104,4 @@ fn setup_panic_hooks() {
.expect("human-panic: printing error message to console failed");
}));
}
Ok(_) => {}
}
}

@ -173,7 +173,7 @@ impl Crate {
fn override_stamp_file(
current_time: DateTime<offset::Local>,
version: &String,
version: &str,
) -> Result<(), failure::Error> {
let path = env::current_exe()?;
@ -210,15 +210,13 @@ impl Crate {
}
/// Read the stamp file and return value assigned to a certain key.
fn return_stamp_file_value(file: &String, word: &str) -> Option<String> {
fn return_stamp_file_value(file: &str, word: &str) -> Option<String> {
let created = file
.lines()
.find(|line| line.starts_with(word))
.and_then(|l| l.split_whitespace().nth(1));
let value = created.map(|s| s.to_string());
value
created.map(|s| s.to_string())
}
/// Call to the crates.io api and return the latest version of `wasm-pack`

Loading…
Cancel
Save