servo: Merge #10610 - Replace instances of infallible unwrap with expect (from jdm:unwrap); r=SimonSapin
authorJosh Matthews <josh@joshmatthews.net>
Thu, 14 Apr 2016 20:32:52 +0500
changeset 338520 cd18e2f5c7f6ac34fc2d72788897048d1796f57b
parent 338519 14e80afdf536718c1785ff674fbcb3d3dcf1dc0b
child 338521 cc63ce19e283618328172c38719ad91a788e5c55
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersSimonSapin
servo: Merge #10610 - Replace instances of infallible unwrap with expect (from jdm:unwrap); r=SimonSapin Source-Repo: https://github.com/servo/servo Source-Revision: 415fd93a502b47c03d2eb856cbd76a99e0bf0392
servo/components/compositing/constellation.rs
--- a/servo/components/compositing/constellation.rs
+++ b/servo/components/compositing/constellation.rs
@@ -862,17 +862,17 @@ impl<LTF: LayoutThreadFactory, STF: Scri
 
         warn!("creating replacement pipeline for about:failure");
 
         let new_pipeline_id = PipelineId::new();
         self.new_pipeline(new_pipeline_id,
                           failure.parent_info,
                           window_size,
                           None,
-                          LoadData::new(Url::parse("about:failure").unwrap()));
+                          LoadData::new(Url::parse("about:failure").expect("infallible")));
 
         self.push_pending_frame(new_pipeline_id, Some(failure.pipeline_id));
 
     }
 
     fn handle_init_load(&mut self, url: Url) {
         let window_size = self.window_size.visible_viewport;
         let root_pipeline_id = PipelineId::new();
@@ -945,17 +945,17 @@ impl<LTF: LayoutThreadFactory, STF: Scri
             let source_pipeline =  match self.pipelines.get(&load_info.containing_pipeline_id) {
                 Some(source_pipeline) => source_pipeline,
                 None => return warn!("Script loaded url in closed iframe {}.", load_info.containing_pipeline_id),
             };
 
             // If no url is specified, reload.
             let new_url = load_info.url.clone()
                 .or_else(|| old_pipeline.map(|old_pipeline| old_pipeline.url.clone()))
-                .unwrap_or_else(|| Url::parse("about:blank").unwrap());
+                .unwrap_or_else(|| Url::parse("about:blank").expect("infallible"));
 
             // Compare the pipeline's url to the new url. If the origin is the same,
             // then reuse the script thread in creating the new pipeline
             let source_url = &source_pipeline.url;
 
             let same_script = source_url.host() == new_url.host() &&
                               source_url.port() == new_url.port() &&
                               load_info.sandbox == IFrameSandboxState::IFrameUnsandboxed;