Skip to content

Commit 9294ddc

Browse files
committed
Run clippy
1 parent 329770b commit 9294ddc

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ matrix:
1818
- cargo update
1919
- cargo test --all --locked --verbose
2020
- cargo doc --verbose
21-
- rustup component add rustfmt
21+
- rustup component add clippy rustfmt
22+
- cargo clippy --all-targets -- -D warnings
2223
- cargo fmt --all -- --check
2324

2425
- rust: nightly
2526
script:
2627
- cargo update
2728
- cargo test --locked
28-
- rustup component add rustfmt
29+
- rustup component add clippy rustfmt
30+
- cargo clippy --all-targets -- -D warnings
2931
- cargo fmt --all -- --check
3032

3133
branches:

src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,8 @@ fn open_browser_internal(browser: Browser, url: &str) -> Result<Output> {
227227
/// Open on Linux using the $BROWSER env var
228228
#[cfg(target_os = "linux")]
229229
fn open_on_linux_using_browser_env(url: &str) -> Result<Output> {
230-
let browsers = ::std::env::var("BROWSER").map_err(|_| -> Error {
231-
Error::new(ErrorKind::NotFound, format!("BROWSER env not set"))
232-
})?;
230+
let browsers = ::std::env::var("BROWSER")
231+
.map_err(|_| -> Error { Error::new(ErrorKind::NotFound, "BROWSER env not set") })?;
233232
for browser in browsers.split(':') {
234233
// $BROWSER can contain ':' delimited options, each representing a potential browser command line
235234
if !browser.is_empty() {
@@ -253,10 +252,10 @@ fn open_on_linux_using_browser_env(url: &str) -> Result<Output> {
253252
}
254253
}
255254
}
256-
return Err(Error::new(
255+
Err(Error::new(
257256
ErrorKind::NotFound,
258257
"No valid command in $BROWSER",
259-
));
258+
))
260259
}
261260

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

0 commit comments

Comments
 (0)