Better bindgen error message when files are missing.

This is only slightly more informative because it doesn't give
the filename, but I think it's an improvement on the simple
unwrap() panic when we try to read a file which isn't there.

See also [Gecko bug 1368083](https://bugzilla.mozilla.org/show_bug.cgi?id=1368083).
This commit is contained in:
Ralph Giles 2017-07-06 09:09:09 -07:00
parent 8db2775ba6
commit ec49c4d8c8

View file

@ -133,7 +133,8 @@ mod bindings {
} }
fn update_last_modified(file: &Path) { fn update_last_modified(file: &Path) {
let modified = get_modified_time(file).unwrap(); let modified = get_modified_time(file)
.expect("Couldn't get file modification time");
let mut last_modified = LAST_MODIFIED.lock().unwrap(); let mut last_modified = LAST_MODIFIED.lock().unwrap();
*last_modified = cmp::max(modified, *last_modified); *last_modified = cmp::max(modified, *last_modified);
} }