summaryrefslogtreecommitdiff
path: root/src/image.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-30 11:48:51 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-30 11:48:51 +0200
commit65c0c5607e56ca8bc7866d94b2496a25e096149a (patch)
tree2cb087a9ff524aefa6cff7fc7e1629aaa6bc886b /src/image.rs
parent470f8001a1dba0022ec9d3e46c67c3bbc31359be (diff)
Make clippy a bit happier
Diffstat (limited to 'src/image.rs')
-rw-r--r--src/image.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/image.rs b/src/image.rs
index 90252ff3..f4617c5a 100644
--- a/src/image.rs
+++ b/src/image.rs
@@ -54,6 +54,7 @@ impl Debug for Image {
}
/// Caches decoded images.
+#[derive(Default)]
pub struct ImageCache {
/// Maps from file hashes to ids of decoded images.
images: HashMap<ImageId, Image>,
@@ -64,7 +65,7 @@ pub struct ImageCache {
impl ImageCache {
/// Create a new, empty image cache.
pub fn new() -> Self {
- Self { images: HashMap::new(), on_load: None }
+ Self::default()
}
/// Load and decode an image file from a path.