aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Giles <giles@mozilla.com>2017-07-06 09:09:09 -0700
committerRalph Giles <giles@mozilla.com>2017-07-07 22:49:45 -0700
commitec49c4d8c82bfe84bdda7dcaf942f176d00a9851 (patch)
treeaebf5a9783468e71f56fae5bb477c628930aedc3
parent8db2775ba6a81d267b3b355e819bb0d90011506f (diff)
downloadservo-ec49c4d8c82bfe84bdda7dcaf942f176d00a9851.tar.gz
servo-ec49c4d8c82bfe84bdda7dcaf942f176d00a9851.zip
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).
-rw-r--r--components/style/build_gecko.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs
index 31717d7ad07..de8daefd3ab 100644
--- a/components/style/build_gecko.rs
+++ b/components/style/build_gecko.rs
@@ -133,7 +133,8 @@ mod bindings {
}
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();
*last_modified = cmp::max(modified, *last_modified);
}