Skip to content

Commit

Permalink
Use question_mark feature in linkchecker.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedcharles committed Sep 11, 2016
1 parent 4812cf3 commit f1c6cad
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tools/linkchecker/main.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit f1c6cad

Please sign in to comment.