Skip to content

Commit fd20c15

Browse files
authored
Fix a clippy lint (#227)
This showed up as a clippy warning (parameterless new but no default) when removing `#![allow(clippy::all)]` on our `main`, though surprisingly this doesn't happen on upstream `dev`. I think it's a good change either way.
1 parent 4292cbf commit fd20c15

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/internal/arena.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,15 @@ impl<T: fmt::Debug> fmt::Debug for Arena<T> {
8686
}
8787
}
8888

89+
impl<T> Default for Arena<T> {
90+
fn default() -> Self {
91+
Self::new()
92+
}
93+
}
94+
8995
impl<T> Arena<T> {
90-
pub fn new() -> Arena<T> {
91-
Arena { data: Vec::new() }
96+
pub fn new() -> Self {
97+
Self { data: Vec::new() }
9298
}
9399

94100
pub fn alloc(&mut self, value: T) -> Id<T> {

0 commit comments

Comments
 (0)