Skip to content

Commit dd9dde6

Browse files
mreByron
authored andcommitted
Adjust code style
1 parent 4e41d8b commit dd9dde6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//! match open::that("http://rust-lang.org") {
2525
//! Ok(exit_status) => {
2626
//! if exit_status.success() {
27-
//! println!("Look at your browser !");
27+
//! println!("Look at your browser!");
2828
//! } else {
2929
//! if let Some(code) = exit_status.code() {
3030
//! println!("Command returned non-zero exit status {}!", code);
@@ -65,10 +65,10 @@ pub fn that<T: AsRef<OsStr> + Sized>(path: T) -> io::Result<ExitStatus> {
6565
} else {
6666
cmd.arg(path.as_ref());
6767
}
68-
try!(cmd.spawn()).wait()
68+
cmd.spawn()?.wait()
6969
}
7070

7171
#[cfg(target_os = "macos")]
7272
pub fn that<T: AsRef<OsStr> + Sized>(path: T) -> io::Result<ExitStatus> {
73-
try!(Command::new("open").arg(path.as_ref()).spawn()).wait()
73+
Command::new("open").arg(path.as_ref()).spawn()?.wait()
7474
}

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::env;
55
use std::process;
66

77
fn main() {
8-
let path_or_url = match env::args().skip(1).next() {
8+
let path_or_url = match env::args().nth(1) {
99
Some(arg) => arg,
1010
None => {
1111
writeln!(stderr(), "usage: open <path-or-url>").ok();

0 commit comments

Comments
 (0)