Some small debug changes
MODIFY
wgpu/src/image/raster.rs
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,
}

MODIFY
wgpu/src/image/vector.rs
wgpu/src/image/vector.rs
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;
}

Some small debug changes