We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
clippy::new-without-default
HashArena
1 parent 8a8b084 commit 05b0934Copy full SHA for 05b0934
src/internal/arena.rs
@@ -150,9 +150,7 @@ impl<T: Hash + Eq + fmt::Debug> fmt::Debug for HashArena<T> {
150
151
impl<T: Hash + Eq> HashArena<T> {
152
pub fn new() -> Self {
153
- HashArena {
154
- data: FnvIndexSet::default(),
155
- }
+ Self::default()
156
}
157
158
pub fn alloc(&mut self, value: T) -> Id<T> {
@@ -161,6 +159,14 @@ impl<T: Hash + Eq> HashArena<T> {
161
159
162
160
163
+impl<T: Hash + Eq> Default for HashArena<T> {
+ fn default() -> Self {
164
+ Self {
165
+ data: FnvIndexSet::default(),
166
+ }
167
168
+}
169
+
170
impl<T: Hash + Eq> Index<Id<T>> for HashArena<T> {
171
type Output = T;
172
fn index(&self, id: Id<T>) -> &T {
0 commit comments