From 4a335e9c9f69d84b31a68ffceb812349df6308eb Mon Sep 17 00:00:00 2001 From: tigercosmos Date: Sat, 23 Sep 2017 17:11:51 -0500 Subject: [PATCH] servo: Merge #18603 - fix #18594: Unnecessarily allocating an error string (from tigercosmos:allocating); r=KiChjang r? @asajeffrey --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #18594 (github issue number if applicable). - [ ] There are tests for these changes OR - [X] These changes do not require tests because _____ Source-Repo: https://github.com/servo/servo Source-Revision: 35aad086191c7c4561067a1f774b3ae2d69bc375 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 50ce2afd344fbaeb4e453929b4bba0e22ab4b027 --- servo/components/script/document_loader.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servo/components/script/document_loader.rs b/servo/components/script/document_loader.rs index 4a6307667f12..9fe42e301477 100644 --- a/servo/components/script/document_loader.rs +++ b/servo/components/script/document_loader.rs @@ -130,7 +130,7 @@ impl DocumentLoader { pub fn finish_load(&mut self, load: &LoadType) { debug!("Removing blocking load {:?} ({}).", load, self.blocking_loads.len()); let idx = self.blocking_loads.iter().position(|unfinished| *unfinished == *load); - self.blocking_loads.remove(idx.expect(&format!("unknown completed load {:?}", load))); + self.blocking_loads.remove(idx.unwrap_or_else(|| panic!("unknown completed load {:?}", load))); } pub fn is_blocked(&self) -> bool {