Skip to content

Commit

Permalink
Rollup merge of rust-lang#38422 - zackmdavis:enjoy_tidy_path_error_ma…
Browse files Browse the repository at this point in the history
…cro_nicety, r=bluss

tidy features: use 2-parameter form of internal try macro for open err

This tiny patch merely applies @bluss's suggestion for how to get a more
informative error message when the feature check can't open a file, a
matter that had briefly annoyed the present author, leading to the
filing of rust-lang#38417.

Resolves rust-lang#38417.
  • Loading branch information
sanxiyn committed Dec 19, 2016
2 parents 4b5cffc + ca37604 commit 813af34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn check(path: &Path, bad: &mut bool) {
}

contents.truncate(0);
t!(t!(File::open(file)).read_to_string(&mut contents));
t!(t!(File::open(&file), &file).read_to_string(&mut contents));

for (i, line) in contents.lines().enumerate() {
let mut err = |msg: &str| {
Expand Down

0 comments on commit 813af34

Please sign in to comment.