Skip to content
Snippets Groups Projects
Unverified Commit fc0e0b52 authored by Alejandro Perea's avatar Alejandro Perea Committed by GitHub
Browse files

Fix some clippy warnings (#214)

parent 9c7082b9
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- `TileLayer::width` & `TileLayer::height` for ergonomic access of width/height. - `TileLayer::width` & `TileLayer::height` for ergonomic access of width/height.
- `FiniteTileLayerData::get_tile_data`, `InfiniteTileLayerData::get_tile_data`. - `FiniteTileLayerData::get_tile_data`, `InfiniteTileLayerData::get_tile_data`.
- `Default` derived implementation for `Loader` & `FilesystemResourceCache`
### Changed ### Changed
- Update `zstd` to `0.11.0`. - Update `zstd` to `0.11.0`.
......
...@@ -50,7 +50,7 @@ pub trait ResourceCache { ...@@ -50,7 +50,7 @@ pub trait ResourceCache {
} }
/// A cache that identifies resources by their path in the user's filesystem. /// A cache that identifies resources by their path in the user's filesystem.
#[derive(Debug)] #[derive(Debug, Default)]
pub struct FilesystemResourceCache { pub struct FilesystemResourceCache {
tilesets: HashMap<ResourcePathBuf, Arc<Tileset>>, tilesets: HashMap<ResourcePathBuf, Arc<Tileset>>,
} }
......
...@@ -11,7 +11,7 @@ use crate::{Error, FilesystemResourceCache, Map, ResourceCache, Result, Tileset} ...@@ -11,7 +11,7 @@ use crate::{Error, FilesystemResourceCache, Map, ResourceCache, Result, Tileset}
/// This type is used for loading operations because they require a [`ResourceCache`] for /// This type is used for loading operations because they require a [`ResourceCache`] for
/// intermediate artifacts, so using a type for creation can ensure that the cache is reused if /// intermediate artifacts, so using a type for creation can ensure that the cache is reused if
/// loading more than one object is required. /// loading more than one object is required.
#[derive(Debug, Clone)] #[derive(Debug, Clone, Default)]
pub struct Loader<Cache: ResourceCache = FilesystemResourceCache> { pub struct Loader<Cache: ResourceCache = FilesystemResourceCache> {
cache: Cache, cache: Cache,
} }
......
...@@ -105,8 +105,8 @@ impl ObjectData { ...@@ -105,8 +105,8 @@ impl ObjectData {
let height = h.unwrap_or(0f32); let height = h.unwrap_or(0f32);
let rotation = r.unwrap_or(0f32); let rotation = r.unwrap_or(0f32);
let id = id.unwrap_or(0u32); let id = id.unwrap_or(0u32);
let name = n.unwrap_or_else(String::new); let name = n.unwrap_or_default();
let obj_type = t.unwrap_or_else(String::new); let obj_type = t.unwrap_or_default();
let mut shape = None; let mut shape = None;
let mut properties = HashMap::new(); let mut properties = HashMap::new();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment