Commit dd9dde6 1 parent 4e41d8b commit dd9dde6 Copy full SHA for dd9dde6
File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 24
24
//! match open::that("http://rust-lang.org") {
25
25
//! Ok(exit_status) => {
26
26
//! if exit_status.success() {
27
- //! println!("Look at your browser !");
27
+ //! println!("Look at your browser!");
28
28
//! } else {
29
29
//! if let Some(code) = exit_status.code() {
30
30
//! println!("Command returned non-zero exit status {}!", code);
@@ -65,10 +65,10 @@ pub fn that<T: AsRef<OsStr> + Sized>(path: T) -> io::Result<ExitStatus> {
65
65
} else {
66
66
cmd. arg ( path. as_ref ( ) ) ;
67
67
}
68
- try! ( cmd. spawn ( ) ) . wait ( )
68
+ cmd. spawn ( ) ? . wait ( )
69
69
}
70
70
71
71
#[ cfg( target_os = "macos" ) ]
72
72
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 ( )
74
74
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use std::env;
5
5
use std:: process;
6
6
7
7
fn main ( ) {
8
- let path_or_url = match env:: args ( ) . skip ( 1 ) . next ( ) {
8
+ let path_or_url = match env:: args ( ) . nth ( 1 ) {
9
9
Some ( arg) => arg,
10
10
None => {
11
11
writeln ! ( stderr( ) , "usage: open <path-or-url>" ) . ok ( ) ;
You can’t perform that action at this time.
0 commit comments