Skip to content

Commit 5c7dbf6

Browse files
committed
Auto merge of #28986 - ahmedcharles:error-index-generator, r=brson
2 parents 8aa621a + f65dbb1 commit 5c7dbf6

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/error-index-generator/main.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ fn load_all_errors(metadata_dir: &Path) -> Result<ErrorMetadataMap, Box<Error>>
3434
let path = try!(entry).path();
3535

3636
let mut metadata_str = String::new();
37-
try!(
38-
File::open(&path).and_then(|mut f|
39-
f.read_to_string(&mut metadata_str))
40-
);
37+
try!(File::open(&path).and_then(|mut f| f.read_to_string(&mut metadata_str)));
4138

4239
let some_errors: ErrorMetadataMap = try!(json::decode(&metadata_str));
4340

@@ -78,24 +75,23 @@ r##"<!DOCTYPE html>
7875
// Enclose each error in a div so they can be shown/hidden en masse.
7976
let desc_desc = match info.description {
8077
Some(_) => "error-described",
81-
None => "error-undescribed"
78+
None => "error-undescribed",
8279
};
8380
let use_desc = match info.use_site {
8481
Some(_) => "error-used",
85-
None => "error-unused"
82+
None => "error-unused",
8683
};
8784
try!(write!(&mut output_file, "<div class=\"{} {}\">", desc_desc, use_desc));
8885

8986
// Error title (with self-link).
9087
try!(write!(&mut output_file,
91-
"<h2 id=\"{0}\" class=\"section-header\"><a href=\"#{0}\">{0}</a></h2>\n",
92-
err_code
93-
));
88+
"<h2 id=\"{0}\" class=\"section-header\"><a href=\"#{0}\">{0}</a></h2>\n",
89+
err_code));
9490

9591
// Description rendered as markdown.
9692
match info.description {
9793
Some(ref desc) => try!(write!(&mut output_file, "{}", Markdown(desc))),
98-
None => try!(write!(&mut output_file, "<p>No description.</p>\n"))
94+
None => try!(write!(&mut output_file, "<p>No description.</p>\n")),
9995
}
10096

10197
try!(write!(&mut output_file, "</div>\n"));

0 commit comments

Comments
 (0)