diff options
Diffstat (limited to 'wgpu')
-rw-r--r-- | wgpu/src/image/raster.rs | 5 | ||||
-rw-r--r-- | wgpu/src/image/vector.rs | 19 |
2 files changed, 12 insertions, 12 deletions
diff --git a/wgpu/src/image/raster.rs b/wgpu/src/image/raster.rs index 651ec078..33750cac 100644 --- a/wgpu/src/image/raster.rs +++ b/wgpu/src/image/raster.rs @@ -8,7 +8,10 @@ use debug_stub_derive::*; #[derive(DebugStub)] pub enum Memory { Host(::image::ImageBuffer<::image::Bgra<u8>, Vec<u8>>), - Device(#[debug_stub="ReplacementValue"]Allocation), + Device( + #[debug_stub="ReplacementValue"] + Allocation + ), NotFound, Invalid, } diff --git a/wgpu/src/image/vector.rs b/wgpu/src/image/vector.rs index 89477877..2afe7d92 100644 --- a/wgpu/src/image/vector.rs +++ b/wgpu/src/image/vector.rs @@ -1,20 +1,23 @@ use iced_native::svg; use std::{ collections::{HashMap, HashSet}, - fmt, }; use guillotiere::{Allocation, AtlasAllocator, Size}; use debug_stub_derive::*; +#[derive(DebugStub)] pub enum Svg { - Loaded { tree: resvg::usvg::Tree }, + Loaded( + #[debug_stub="ReplacementValue"] + resvg::usvg::Tree + ), NotFound, } impl Svg { pub fn viewport_dimensions(&self) -> (u32, u32) { match self { - Svg::Loaded { tree } => { + Svg::Loaded(tree) => { let size = tree.svg_node().size; (size.width() as u32, size.height() as u32) @@ -24,12 +27,6 @@ impl Svg { } } -impl fmt::Debug for Svg { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "Svg") - } -} - #[derive(DebugStub)] pub struct Cache { svgs: HashMap<u64, Svg>, @@ -57,7 +54,7 @@ impl Cache { let opt = resvg::Options::default(); let svg = match resvg::usvg::Tree::from_file(handle.path(), &opt.usvg) { - Ok(tree) => Svg::Loaded { tree }, + Ok(tree) => Svg::Loaded(tree), Err(_) => Svg::NotFound, }; @@ -96,7 +93,7 @@ impl Cache { let _ = self.load(handle); match self.svgs.get(&handle.id()).unwrap() { - Svg::Loaded { tree } => { + Svg::Loaded(tree) => { if width == 0 || height == 0 { return None; } |