]> git.lizzy.rs Git - rust.git/commitdiff
Use question_mark feature in linkchecker.
authorAhmed Charles <acharles@outlook.com>
Sat, 27 Aug 2016 08:42:56 +0000 (01:42 -0700)
committerAhmed Charles <acharles@outlook.com>
Sun, 11 Sep 2016 23:00:50 +0000 (16:00 -0700)
src/tools/linkchecker/main.rs

index 27adabbc72e588c8398ffc1bdca28ce2a9d45de9..3e2bc9032a1ccae31c4ca3e8a60847ce2aec90d3 100644 (file)
@@ -24,6 +24,8 @@
 //! A few whitelisted exceptions are allowed as there's known bugs in rustdoc,
 //! but this should catch the majority of "broken link" cases.
 
+#![feature(question_mark)]
+
 extern crate url;
 
 use std::env;
@@ -243,15 +245,14 @@ fn load_file(cache: &mut Cache,
             None
         }
         Entry::Vacant(entry) => {
-            let mut fp = try!(File::open(file.clone()).map_err(|err| {
+            let mut fp = File::open(file.clone()).map_err(|err| {
                 if let FromRedirect(true) = redirect {
                     LoadError::BrokenRedirect(file.clone(), err)
                 } else {
                     LoadError::IOError(err)
                 }
-            }));
-            try!(fp.read_to_string(&mut contents)
-                   .map_err(|err| LoadError::IOError(err)));
+            })?;
+            fp.read_to_string(&mut contents).map_err(|err| LoadError::IOError(err))?;
 
             let maybe = maybe_redirect(&contents);
             if maybe.is_some() {