Skip to content

Commit

Permalink
Adjust code style
Browse files Browse the repository at this point in the history
  • Loading branch information
mre authored and Byron committed Mar 19, 2018
1 parent 4e41d8b commit dd9dde6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//! match open::that("http://rust-lang.org") {
//! Ok(exit_status) => {
//! if exit_status.success() {
//! println!("Look at your browser !");
//! println!("Look at your browser!");
//! } else {
//! if let Some(code) = exit_status.code() {
//! println!("Command returned non-zero exit status {}!", code);
Expand Down Expand Up @@ -65,10 +65,10 @@ pub fn that<T: AsRef<OsStr> + Sized>(path: T) -> io::Result<ExitStatus> {
} else {
cmd.arg(path.as_ref());
}
try!(cmd.spawn()).wait()
cmd.spawn()?.wait()
}

#[cfg(target_os = "macos")]
pub fn that<T: AsRef<OsStr> + Sized>(path: T) -> io::Result<ExitStatus> {
try!(Command::new("open").arg(path.as_ref()).spawn()).wait()
Command::new("open").arg(path.as_ref()).spawn()?.wait()
}
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::env;
use std::process;

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

0 comments on commit dd9dde6

Please sign in to comment.