Skip to content

Commit 0085fdb

Browse files
committed
no need to manual impl default
1 parent d9d2a7f commit 0085fdb

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/shape_run_cache.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,13 @@ pub struct ShapeRunKey {
1313
}
1414

1515
/// A helper structure for caching shape runs.
16-
#[derive(Clone)]
16+
#[derive(Clone, Default)]
1717
pub struct ShapeRunCache {
1818
age: u64,
1919
cache: HashMap<ShapeRunKey, (u64, Vec<ShapeGlyph>)>,
2020
age_registries: Vec<HashSet<ShapeRunKey>>,
2121
}
2222

23-
impl Default for ShapeRunCache {
24-
fn default() -> Self {
25-
Self {
26-
age: 0,
27-
cache: Default::default(),
28-
age_registries: vec![HashSet::default()],
29-
}
30-
}
31-
}
32-
3323
impl ShapeRunCache {
3424
/// Get cache item, updating age if found
3525
pub fn get(&mut self, key: &ShapeRunKey) -> Option<&Vec<ShapeGlyph>> {

0 commit comments

Comments
 (0)