diff options
author | 2019-11-24 11:34:30 +0100 | |
---|---|---|
committer | 2019-11-24 11:34:30 +0100 | |
commit | 149fd2aa1fa86858c7c1dcec8fd844caa78cec94 (patch) | |
tree | a199cf8d2caaf6aa60e48e93d6dd0688969d43b0 /wgpu/src/text.rs | |
parent | 9712b319bb7a32848001b96bd84977430f14b623 (diff) | |
parent | 47196c9007d12d3b3e0036ffabe3bf6d14ff4523 (diff) | |
download | iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.gz iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.bz2 iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.zip |
Merge pull request #65 from hecrj/improvement/docs
Documentation
Diffstat (limited to 'wgpu/src/text.rs')
-rw-r--r-- | wgpu/src/text.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index da070f5c..bf37abe5 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -2,8 +2,7 @@ mod font; use crate::Transformation; -use std::cell::RefCell; -use std::collections::HashMap; +use std::{cell::RefCell, collections::HashMap}; pub const BUILTIN_ICONS: iced_native::Font = iced_native::Font::External { name: "iced_wgpu icons", @@ -12,6 +11,7 @@ pub const BUILTIN_ICONS: iced_native::Font = iced_native::Font::External { pub const CHECKMARK_ICON: char = '\u{F00C}'; +#[derive(Debug)] pub struct Pipeline { draw_brush: RefCell<wgpu_glyph::GlyphBrush<'static, ()>>, draw_font_map: RefCell<HashMap<String, wgpu_glyph::FontId>>, @@ -56,7 +56,7 @@ impl Pipeline { wgpu_glyph::FontId(0) } - pub fn queue(&mut self, section: wgpu_glyph::Section) { + pub fn queue(&mut self, section: wgpu_glyph::Section<'_>) { self.draw_brush.borrow_mut().queue(section); } @@ -134,7 +134,8 @@ impl Pipeline { // it uses a lifetimed `GlyphCalculatorGuard` with side-effects on drop. // This makes stuff quite inconvenient. A manual method for trimming the // cache would make our lives easier. - self.measure_brush + let _ = self + .measure_brush .borrow_mut() .process_queued(|_, _| {}, |_| {}) .expect("Trim text measurements"); @@ -154,7 +155,8 @@ impl Pipeline { let font_id = self.draw_brush.borrow_mut().add_font_bytes(bytes); - self.draw_font_map + let _ = self + .draw_font_map .borrow_mut() .insert(String::from(name), font_id); |