diff options
-rw-r--r-- | components/gfx/font_cache_thread.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/components/gfx/font_cache_thread.rs b/components/gfx/font_cache_thread.rs index 314def3b2cf..4ba4af2b39f 100644 --- a/components/gfx/font_cache_thread.rs +++ b/components/gfx/font_cache_thread.rs @@ -423,10 +423,13 @@ impl FontCacheThread { pub fn find_font_template(&self, family: FontFamily, desc: FontTemplateDescriptor) -> Option<FontTemplateInfo> { - let (response_chan, response_port) = ipc::channel().unwrap(); - self.chan.send(Command::GetFontTemplate(family, desc, response_chan)).unwrap(); + let (response_chan, response_port) = + ipc::channel().expect("failed to create IPC channel"); + self.chan.send(Command::GetFontTemplate(family, desc, response_chan)) + .expect("failed to send message to font cache thread"); - let reply = response_port.recv().unwrap(); + let reply = response_port.recv() + .expect("failed to receive response to font request"); match reply { Reply::GetFontTemplateReply(data) => { @@ -437,10 +440,13 @@ impl FontCacheThread { pub fn last_resort_font_template(&self, desc: FontTemplateDescriptor) -> FontTemplateInfo { - let (response_chan, response_port) = ipc::channel().unwrap(); - self.chan.send(Command::GetLastResortFontTemplate(desc, response_chan)).unwrap(); + let (response_chan, response_port) = + ipc::channel().expect("failed to create IPC channel"); + self.chan.send(Command::GetLastResortFontTemplate(desc, response_chan)) + .expect("failed to send message to font cache thread"); - let reply = response_port.recv().unwrap(); + let reply = response_port.recv() + .expect("failed to receive response to font request"); match reply { Reply::GetFontTemplateReply(data) => { |