Skip to content

Commit

Permalink
Run clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Dec 17, 2018
1 parent ec969b0 commit 81cb934
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ matrix:
- cargo update
- cargo test --all --locked --verbose
- cargo doc --verbose
- rustup component add rustfmt
- rustup component add clippy rustfmt
- cargo clippy --all-targets -- -D warnings
- cargo fmt --all -- --check

- rust: nightly
script:
- cargo update
- cargo test --locked
- rustup component add rustfmt
- rustup component add clippy rustfmt
- cargo clippy --all-targets -- -D warnings
- cargo fmt --all -- --check

branches:
Expand Down
9 changes: 4 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,8 @@ fn open_browser_internal(browser: Browser, url: &str) -> Result<Output> {
/// Open on Linux using the $BROWSER env var
#[cfg(target_os = "linux")]
fn open_on_linux_using_browser_env(url: &str) -> Result<Output> {
let browsers = ::std::env::var("BROWSER").map_err(|_| -> Error {
Error::new(ErrorKind::NotFound, format!("BROWSER env not set"))
})?;
let browsers = ::std::env::var("BROWSER")
.map_err(|_| -> Error { Error::new(ErrorKind::NotFound, "BROWSER env not set") })?;
for browser in browsers.split(':') {
// $BROWSER can contain ':' delimited options, each representing a potential browser command line
if !browser.is_empty() {
Expand All @@ -285,10 +284,10 @@ fn open_on_linux_using_browser_env(url: &str) -> Result<Output> {
}
}
}
return Err(Error::new(
Err(Error::new(
ErrorKind::NotFound,
"No valid command in $BROWSER",
));
))
}

#[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))]
Expand Down

0 comments on commit 81cb934

Please sign in to comment.