try! -> ?
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
This commit is contained in:
parent
0dcc413e42
commit
0f02309e4b
132 changed files with 3755 additions and 3770 deletions
|
@ -332,10 +332,10 @@ fn parse_externs(matches: &getopts::Matches) -> Result<core::Externs, String> {
|
|||
let mut externs = HashMap::new();
|
||||
for arg in &matches.opt_strs("extern") {
|
||||
let mut parts = arg.splitn(2, '=');
|
||||
let name = try!(parts.next().ok_or("--extern value must not be empty".to_string()));
|
||||
let location = try!(parts.next()
|
||||
let name = parts.next().ok_or("--extern value must not be empty".to_string())?;
|
||||
let location = parts.next()
|
||||
.ok_or("--extern value must be of the format `foo=bar`"
|
||||
.to_string()));
|
||||
.to_string())?;
|
||||
let name = name.to_string();
|
||||
externs.entry(name).or_insert(vec![]).push(location.to_string());
|
||||
}
|
||||
|
@ -502,6 +502,6 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
|
|||
json.insert("crate".to_string(), crate_json);
|
||||
json.insert("plugins".to_string(), Json::Object(plugins_json));
|
||||
|
||||
let mut file = try!(File::create(&dst));
|
||||
let mut file = File::create(&dst)?;
|
||||
write!(&mut file, "{}", Json::Object(json))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue