Skip to content

Commit e3bc9c4

Browse files
committed
Moved lints to Cargo.toml.
1 parent 3e7c8ae commit e3bc9c4

23 files changed

+97
-68
lines changed

Cargo.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,30 @@ default = ["std"]
5555
fatal-warnings = []
5656
std = []
5757

58+
[lints.clippy]
59+
all = { level = "warn", priority = -1 }
60+
pedantic = { level = "warn", priority = -1 }
61+
correctness = "deny"
62+
63+
enum-glob-use = "allow"
64+
if-not-else = "allow"
65+
match-bool = "allow"
66+
match-same-arms = "allow"
67+
missing-panics-doc = "allow"
68+
module-name-repetitions = "allow"
69+
similar-names = "allow"
70+
single-match-else = "allow"
71+
type-complexity = "allow"
72+
type-repetition-in-bounds = "allow"
73+
unnested-or-patterns = "allow"
74+
use-self = "allow"
75+
wildcard-imports = "allow"
76+
77+
[lints.rustdoc]
78+
# TODO This is only needed because `cargo-rdme` requires a path like `crate::⋯`. Once that limitation is lifted we
79+
# can remove this.
80+
redundant-explicit-links = "allow"
81+
5882
[package.metadata.docs.rs]
5983
features = ["serde"]
6084

benches/rpds_hash_trie_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn rpds_hash_trie_map_insert(c: &mut Criterion) {
2121
}
2222

2323
map
24-
})
24+
});
2525
});
2626
}
2727

@@ -37,7 +37,7 @@ fn rpds_hash_trie_map_insert_mut(c: &mut Criterion) {
3737
}
3838

3939
map
40-
})
40+
});
4141
});
4242
}
4343

@@ -104,7 +104,7 @@ fn rpds_hash_trie_map_get(c: &mut Criterion) {
104104
for i in 0..limit {
105105
black_box(map.get(&i));
106106
}
107-
})
107+
});
108108
});
109109
}
110110

@@ -121,7 +121,7 @@ fn rpds_hash_trie_map_iterate(c: &mut Criterion) {
121121
for kv in map.iter() {
122122
black_box(kv);
123123
}
124-
})
124+
});
125125
});
126126
}
127127

benches/rpds_hash_trie_map_sync.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn rpds_hash_trie_map_sync_insert(c: &mut Criterion) {
2121
}
2222

2323
map
24-
})
24+
});
2525
});
2626
}
2727

@@ -37,7 +37,7 @@ fn rpds_hash_trie_map_sync_insert_mut(c: &mut Criterion) {
3737
}
3838

3939
map
40-
})
40+
});
4141
});
4242
}
4343

@@ -104,7 +104,7 @@ fn rpds_hash_trie_map_sync_get(c: &mut Criterion) {
104104
for i in 0..limit {
105105
black_box(map.get(&i));
106106
}
107-
})
107+
});
108108
});
109109
}
110110

@@ -121,7 +121,7 @@ fn rpds_hash_trie_map_sync_iterate(c: &mut Criterion) {
121121
for kv in map.iter() {
122122
black_box(kv);
123123
}
124-
})
124+
});
125125
});
126126
}
127127

benches/rpds_list.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn rpds_list_push_front(c: &mut Criterion) {
2121
}
2222

2323
list
24-
})
24+
});
2525
});
2626
}
2727

@@ -37,7 +37,7 @@ fn rpds_list_push_front_mut(c: &mut Criterion) {
3737
}
3838

3939
list
40-
})
40+
});
4141
});
4242
}
4343

@@ -141,6 +141,7 @@ fn rpds_list_reverse_mut(c: &mut Criterion) {
141141
});
142142
}
143143

144+
#[allow(clippy::explicit_iter_loop)]
144145
fn rpds_list_iterate(c: &mut Criterion) {
145146
let limit = 100_000;
146147
let mut list = List::new();
@@ -154,7 +155,7 @@ fn rpds_list_iterate(c: &mut Criterion) {
154155
for i in list.iter() {
155156
black_box(i);
156157
}
157-
})
158+
});
158159
});
159160
}
160161

benches/rpds_list_sync.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn rpds_list_sync_push_front(c: &mut Criterion) {
2121
}
2222

2323
list
24-
})
24+
});
2525
});
2626
}
2727

@@ -37,7 +37,7 @@ fn rpds_list_sync_push_front_mut(c: &mut Criterion) {
3737
}
3838

3939
list
40-
})
40+
});
4141
});
4242
}
4343

@@ -141,6 +141,7 @@ fn rpds_list_sync_reverse_mut(c: &mut Criterion) {
141141
});
142142
}
143143

144+
#[allow(clippy::explicit_iter_loop)]
144145
fn rpds_list_sync_iterate(c: &mut Criterion) {
145146
let limit = 1_000_000;
146147
let mut list: ListSync<usize> = ListSync::new_sync();
@@ -154,7 +155,7 @@ fn rpds_list_sync_iterate(c: &mut Criterion) {
154155
for i in list.iter() {
155156
black_box(i);
156157
}
157-
})
158+
});
158159
});
159160
}
160161

benches/rpds_queue.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn rpds_queue_enqueue(c: &mut Criterion) {
2121
}
2222

2323
queue
24-
})
24+
});
2525
});
2626
}
2727

@@ -37,7 +37,7 @@ fn rpds_queue_enqueue_mut(c: &mut Criterion) {
3737
}
3838

3939
queue
40-
})
40+
});
4141
});
4242
}
4343

@@ -91,6 +91,7 @@ fn rpds_queue_dequeue_mut(c: &mut Criterion) {
9191
});
9292
}
9393

94+
#[allow(clippy::explicit_iter_loop)]
9495
fn rpds_queue_iterate(c: &mut Criterion) {
9596
let limit = 100_000;
9697
let mut queue: Queue<usize> = Queue::new();
@@ -104,7 +105,7 @@ fn rpds_queue_iterate(c: &mut Criterion) {
104105
for i in queue.iter() {
105106
black_box(i);
106107
}
107-
})
108+
});
108109
});
109110
}
110111

benches/rpds_queue_sync.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn rpds_queue_sync_enqueue(c: &mut Criterion) {
2121
}
2222

2323
queue
24-
})
24+
});
2525
});
2626
}
2727

@@ -37,7 +37,7 @@ fn rpds_queue_sync_enqueue_mut(c: &mut Criterion) {
3737
}
3838

3939
queue
40-
})
40+
});
4141
});
4242
}
4343

@@ -91,6 +91,7 @@ fn rpds_queue_sync_dequeue_mut(c: &mut Criterion) {
9191
});
9292
}
9393

94+
#[allow(clippy::explicit_iter_loop)]
9495
fn rpds_queue_sync_iterate(c: &mut Criterion) {
9596
let limit = 1_000_000;
9697
let mut queue: QueueSync<usize> = QueueSync::new_sync();
@@ -104,7 +105,7 @@ fn rpds_queue_sync_iterate(c: &mut Criterion) {
104105
for i in queue.iter() {
105106
black_box(i);
106107
}
107-
})
108+
});
108109
});
109110
}
110111

benches/rpds_red_black_tree_map.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn rpds_red_black_tree_map_insert(c: &mut Criterion) {
2121
}
2222

2323
map
24-
})
24+
});
2525
});
2626
}
2727

@@ -37,7 +37,7 @@ fn rpds_red_black_tree_map_insert_mut(c: &mut Criterion) {
3737
}
3838

3939
map
40-
})
40+
});
4141
});
4242
}
4343

@@ -104,10 +104,11 @@ fn rpds_red_black_tree_map_get(c: &mut Criterion) {
104104
for i in 0..limit {
105105
black_box(map.get(&i));
106106
}
107-
})
107+
});
108108
});
109109
}
110110

111+
#[allow(clippy::explicit_iter_loop)]
111112
fn rpds_red_black_tree_map_iterate(c: &mut Criterion) {
112113
let limit = 100_000;
113114
let mut map = RedBlackTreeMap::new();
@@ -121,7 +122,7 @@ fn rpds_red_black_tree_map_iterate(c: &mut Criterion) {
121122
for kv in map.iter() {
122123
black_box(kv);
123124
}
124-
})
125+
});
125126
});
126127
}
127128

benches/rpds_red_black_tree_map_sync.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn rpds_red_black_tree_map_sync_insert(c: &mut Criterion) {
2121
}
2222

2323
map
24-
})
24+
});
2525
});
2626
}
2727

@@ -37,7 +37,7 @@ fn rpds_red_black_tree_map_sync_insert_mut(c: &mut Criterion) {
3737
}
3838

3939
map
40-
})
40+
});
4141
});
4242
}
4343

@@ -104,10 +104,11 @@ fn rpds_red_black_tree_map_sync_get(c: &mut Criterion) {
104104
for i in 0..limit {
105105
black_box(map.get(&i));
106106
}
107-
})
107+
});
108108
});
109109
}
110110

111+
#[allow(clippy::explicit_iter_loop)]
111112
fn rpds_red_black_tree_map_sync_iterate(c: &mut Criterion) {
112113
let limit = 1_000_000;
113114
let mut map = RedBlackTreeMapSync::new_sync();
@@ -121,7 +122,7 @@ fn rpds_red_black_tree_map_sync_iterate(c: &mut Criterion) {
121122
for kv in map.iter() {
122123
black_box(kv);
123124
}
124-
})
125+
});
125126
});
126127
}
127128

benches/rpds_vector.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn rpds_vector_push_back(c: &mut Criterion) {
2121
}
2222

2323
vector
24-
})
24+
});
2525
});
2626
}
2727

@@ -37,7 +37,7 @@ fn rpds_vector_push_back_mut(c: &mut Criterion) {
3737
}
3838

3939
vector
40-
})
40+
});
4141
});
4242
}
4343

@@ -104,10 +104,11 @@ fn rpds_vector_get(c: &mut Criterion) {
104104
for i in 0..limit {
105105
black_box(vector.get(i));
106106
}
107-
})
107+
});
108108
});
109109
}
110110

111+
#[allow(clippy::explicit_iter_loop)]
111112
fn rpds_vector_iterate(c: &mut Criterion) {
112113
let limit = 100_000;
113114
let mut vector: Vector<usize> = Vector::new();
@@ -121,7 +122,7 @@ fn rpds_vector_iterate(c: &mut Criterion) {
121122
for i in vector.iter() {
122123
black_box(i);
123124
}
124-
})
125+
});
125126
});
126127
}
127128

0 commit comments

Comments
 (0)