From ec49c4d8c82bfe84bdda7dcaf942f176d00a9851 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Thu, 6 Jul 2017 09:09:09 -0700 Subject: [PATCH] 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). --- components/style/build_gecko.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }