Skip to content

Commit

Permalink
Merge pull request #43 from ltratt/clippy_fixes
Browse files Browse the repository at this point in the history
Clippy fixes and force Clippy to run in Travis
  • Loading branch information
jacob-hughes authored Nov 26, 2019
2 parents 9dd3072 + a0a78e4 commit 4b03037
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: rust
before_script:
- rustup toolchain install nightly
- rustup component add --toolchain nightly rustfmt-preview || cargo +nightly install --force rustfmt-nightly
- rustup component add clippy rustfmt
script:
- cargo +nightly fmt --all -- --check
- cargo fmt --all -- --check
- cargo test --all
- cargo run --example=rust_lang_tester
- cargo clippy --all-targets -- -D warnings
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
//!
//! Running `cargo test` will now also run your lang tests.
#![allow(clippy::needless_doctest_main)]
#![allow(clippy::new_without_default)]
#![allow(clippy::redundant_closure)]
#![allow(clippy::type_complexity)]
Expand Down
16 changes: 5 additions & 11 deletions src/tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,7 @@ fn run_tests<'a>(
) -> bool {
let test_fname = path.file_stem().unwrap().to_str().unwrap().to_owned();

if !cfg!(unix)
&& tests
.values()
.find(|t| t.status == Status::Signal)
.is_some()
{
if !cfg!(unix) && tests.values().any(|t| t.status == Status::Signal) {
write_ignored(
test_fname.as_str(),
"signal termination not supported on this platform",
Expand Down Expand Up @@ -567,10 +562,10 @@ fn run_tests<'a>(
if status.success() {
failure.status = Some("Success".to_owned());
} else if status.code().is_none() {
failure.status = Some(
format!("Exited due to signal: {}", status.signal().unwrap())
.to_owned(),
);
failure.status = Some(format!(
"Exited due to signal: {}",
status.signal().unwrap()
));
} else {
failure.status = Some("Error".to_owned());
}
Expand All @@ -582,7 +577,6 @@ fn run_tests<'a>(
failure.status =
Some(status.code().map(|x| x.to_string()).unwrap_or_else(|| {
format!("Exited due to signal: {}", status.signal().unwrap())
.to_owned()
}))
}
}
Expand Down

0 comments on commit 4b03037

Please sign in to comment.