diff options
author | 2019-11-22 22:14:24 +0100 | |
---|---|---|
committer | 2019-11-22 22:14:24 +0100 | |
commit | 6a0e442ad68c2b104b7e91ef80798610a79aca6b (patch) | |
tree | 1ed581908a0a45f10f4b58cdc4ce280980a4cce9 /wgpu/src/image.rs | |
parent | fa227255b02adbbfa99801a7baaa4d6d387f7302 (diff) | |
download | iced-6a0e442ad68c2b104b7e91ef80798610a79aca6b.tar.gz iced-6a0e442ad68c2b104b7e91ef80798610a79aca6b.tar.bz2 iced-6a0e442ad68c2b104b7e91ef80798610a79aca6b.zip |
Write docs for `iced_wgpu`
Diffstat (limited to 'wgpu/src/image.rs')
-rw-r--r-- | wgpu/src/image.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs index 75cfa166..96c9ab6d 100644 --- a/wgpu/src/image.rs +++ b/wgpu/src/image.rs @@ -1,11 +1,9 @@ use crate::Transformation; use iced_native::Rectangle; -use std::cell::RefCell; -use std::collections::HashMap; -use std::mem; -use std::rc::Rc; +use std::{cell::RefCell, collections::HashMap, mem, rc::Rc}; +#[derive(Debug)] pub struct Pipeline { cache: RefCell<HashMap<String, Memory>>, @@ -207,7 +205,8 @@ impl Pipeline { if !self.cache.borrow().contains_key(path) { let image = image::open(path).expect("Load image").to_bgra(); - self.cache + let _ = self + .cache .borrow_mut() .insert(path.to_string(), Memory::Host { image }); } @@ -308,6 +307,7 @@ impl Pipeline { } } +#[derive(Debug)] enum Memory { Host { image: image::ImageBuffer<image::Bgra<u8>, Vec<u8>>, |