diff --git a/.travis.yml b/.travis.yml index c9f8ff6..0fbef90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/src/lib.rs b/src/lib.rs index 264fbc8..078b932 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -227,9 +227,8 @@ fn open_browser_internal(browser: Browser, url: &str) -> Result { /// Open on Linux using the $BROWSER env var #[cfg(target_os = "linux")] fn open_on_linux_using_browser_env(url: &str) -> Result { - 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() { @@ -253,10 +252,10 @@ fn open_on_linux_using_browser_env(url: &str) -> Result { } } } - 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")))]