Skip to content

Commit 9b029f0

Browse files
committed
Fix clippy warnings.
1 parent c568dca commit 9b029f0

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

src/context.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -348,19 +348,14 @@ pub struct EntityOrientedDenseMap<K: EntityOrientedMapKey<V>, V> {
348348
// since the ideal state is one chunk per map, the slow case might never be hit,
349349
// unless one `EntityOrientedDenseMap` is used with more than one `EntityDefs`,
350350
// which could still maybe be implemented more efficiently than `FxHashMap`.
351-
#[derive(Clone)]
351+
#[derive(Clone, Default)]
352352
enum SmallFxHashMap<K, V> {
353+
#[default]
353354
Empty,
354355
One(K, V),
355356
More(FxHashMap<K, V>),
356357
}
357358

358-
impl<K, V> Default for SmallFxHashMap<K, V> {
359-
fn default() -> Self {
360-
Self::Empty
361-
}
362-
}
363-
364359
impl<K: Copy + Eq + Hash, V: Default> SmallFxHashMap<K, V> {
365360
fn get_mut_or_insert_default(&mut self, k: K) -> &mut V {
366361
// HACK(eddyb) to avoid borrowing issues, this is done in two stages:

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
clippy::dbg_macro,
7272
clippy::debug_assert_with_mut_call,
7373
clippy::doc_markdown,
74-
clippy::empty_enum,
74+
clippy::empty_enums,
7575
clippy::enum_glob_use,
7676
clippy::exit,
7777
clippy::expl_impl_clone_on_copy,
@@ -121,7 +121,6 @@
121121
clippy::string_add_assign,
122122
clippy::string_add,
123123
clippy::string_lit_as_bytes,
124-
clippy::string_to_string,
125124
clippy::todo,
126125
clippy::trait_duplication_in_bounds,
127126
clippy::unimplemented,

0 commit comments

Comments
 (0)