servo: Merge #18603 - fix #18594: Unnecessarily allocating an error string (from tigercosmos:allocating); r=KiChjang

<!-- Please describe your changes on the following line: -->
r? @asajeffrey

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [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).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

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
This commit is contained in:
tigercosmos 2017-09-23 17:11:51 -05:00
parent 0b79b6657e
commit 4a335e9c9f

View File

@ -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 {