Skip to content

Commit

Permalink
Moved lints to Cargo.toml.
Browse files Browse the repository at this point in the history
  • Loading branch information
orium committed Nov 28, 2023
1 parent 3e7c8ae commit e3bc9c4
Show file tree
Hide file tree
Showing 23 changed files with 97 additions and 68 deletions.
24 changes: 24 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,30 @@ default = ["std"]
fatal-warnings = []
std = []

[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
correctness = "deny"

enum-glob-use = "allow"
if-not-else = "allow"
match-bool = "allow"
match-same-arms = "allow"
missing-panics-doc = "allow"
module-name-repetitions = "allow"
similar-names = "allow"
single-match-else = "allow"
type-complexity = "allow"
type-repetition-in-bounds = "allow"
unnested-or-patterns = "allow"
use-self = "allow"
wildcard-imports = "allow"

[lints.rustdoc]
# TODO This is only needed because `cargo-rdme` requires a path like `crate::⋯`. Once that limitation is lifted we
# can remove this.
redundant-explicit-links = "allow"

[package.metadata.docs.rs]
features = ["serde"]

Expand Down
8 changes: 4 additions & 4 deletions benches/rpds_hash_trie_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn rpds_hash_trie_map_insert(c: &mut Criterion) {
}

map
})
});
});
}

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

map
})
});
});
}

Expand Down Expand Up @@ -104,7 +104,7 @@ fn rpds_hash_trie_map_get(c: &mut Criterion) {
for i in 0..limit {
black_box(map.get(&i));
}
})
});
});
}

Expand All @@ -121,7 +121,7 @@ fn rpds_hash_trie_map_iterate(c: &mut Criterion) {
for kv in map.iter() {
black_box(kv);
}
})
});
});
}

Expand Down
8 changes: 4 additions & 4 deletions benches/rpds_hash_trie_map_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn rpds_hash_trie_map_sync_insert(c: &mut Criterion) {
}

map
})
});
});
}

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

map
})
});
});
}

Expand Down Expand Up @@ -104,7 +104,7 @@ fn rpds_hash_trie_map_sync_get(c: &mut Criterion) {
for i in 0..limit {
black_box(map.get(&i));
}
})
});
});
}

Expand All @@ -121,7 +121,7 @@ fn rpds_hash_trie_map_sync_iterate(c: &mut Criterion) {
for kv in map.iter() {
black_box(kv);
}
})
});
});
}

Expand Down
7 changes: 4 additions & 3 deletions benches/rpds_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn rpds_list_push_front(c: &mut Criterion) {
}

list
})
});
});
}

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

list
})
});
});
}

Expand Down Expand Up @@ -141,6 +141,7 @@ fn rpds_list_reverse_mut(c: &mut Criterion) {
});
}

#[allow(clippy::explicit_iter_loop)]
fn rpds_list_iterate(c: &mut Criterion) {
let limit = 100_000;
let mut list = List::new();
Expand All @@ -154,7 +155,7 @@ fn rpds_list_iterate(c: &mut Criterion) {
for i in list.iter() {
black_box(i);
}
})
});
});
}

Expand Down
7 changes: 4 additions & 3 deletions benches/rpds_list_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn rpds_list_sync_push_front(c: &mut Criterion) {
}

list
})
});
});
}

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

list
})
});
});
}

Expand Down Expand Up @@ -141,6 +141,7 @@ fn rpds_list_sync_reverse_mut(c: &mut Criterion) {
});
}

#[allow(clippy::explicit_iter_loop)]
fn rpds_list_sync_iterate(c: &mut Criterion) {
let limit = 1_000_000;
let mut list: ListSync<usize> = ListSync::new_sync();
Expand All @@ -154,7 +155,7 @@ fn rpds_list_sync_iterate(c: &mut Criterion) {
for i in list.iter() {
black_box(i);
}
})
});
});
}

Expand Down
7 changes: 4 additions & 3 deletions benches/rpds_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn rpds_queue_enqueue(c: &mut Criterion) {
}

queue
})
});
});
}

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

queue
})
});
});
}

Expand Down Expand Up @@ -91,6 +91,7 @@ fn rpds_queue_dequeue_mut(c: &mut Criterion) {
});
}

#[allow(clippy::explicit_iter_loop)]
fn rpds_queue_iterate(c: &mut Criterion) {
let limit = 100_000;
let mut queue: Queue<usize> = Queue::new();
Expand All @@ -104,7 +105,7 @@ fn rpds_queue_iterate(c: &mut Criterion) {
for i in queue.iter() {
black_box(i);
}
})
});
});
}

Expand Down
7 changes: 4 additions & 3 deletions benches/rpds_queue_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn rpds_queue_sync_enqueue(c: &mut Criterion) {
}

queue
})
});
});
}

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

queue
})
});
});
}

Expand Down Expand Up @@ -91,6 +91,7 @@ fn rpds_queue_sync_dequeue_mut(c: &mut Criterion) {
});
}

#[allow(clippy::explicit_iter_loop)]
fn rpds_queue_sync_iterate(c: &mut Criterion) {
let limit = 1_000_000;
let mut queue: QueueSync<usize> = QueueSync::new_sync();
Expand All @@ -104,7 +105,7 @@ fn rpds_queue_sync_iterate(c: &mut Criterion) {
for i in queue.iter() {
black_box(i);
}
})
});
});
}

Expand Down
9 changes: 5 additions & 4 deletions benches/rpds_red_black_tree_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn rpds_red_black_tree_map_insert(c: &mut Criterion) {
}

map
})
});
});
}

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

map
})
});
});
}

Expand Down Expand Up @@ -104,10 +104,11 @@ fn rpds_red_black_tree_map_get(c: &mut Criterion) {
for i in 0..limit {
black_box(map.get(&i));
}
})
});
});
}

#[allow(clippy::explicit_iter_loop)]
fn rpds_red_black_tree_map_iterate(c: &mut Criterion) {
let limit = 100_000;
let mut map = RedBlackTreeMap::new();
Expand All @@ -121,7 +122,7 @@ fn rpds_red_black_tree_map_iterate(c: &mut Criterion) {
for kv in map.iter() {
black_box(kv);
}
})
});
});
}

Expand Down
9 changes: 5 additions & 4 deletions benches/rpds_red_black_tree_map_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn rpds_red_black_tree_map_sync_insert(c: &mut Criterion) {
}

map
})
});
});
}

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

map
})
});
});
}

Expand Down Expand Up @@ -104,10 +104,11 @@ fn rpds_red_black_tree_map_sync_get(c: &mut Criterion) {
for i in 0..limit {
black_box(map.get(&i));
}
})
});
});
}

#[allow(clippy::explicit_iter_loop)]
fn rpds_red_black_tree_map_sync_iterate(c: &mut Criterion) {
let limit = 1_000_000;
let mut map = RedBlackTreeMapSync::new_sync();
Expand All @@ -121,7 +122,7 @@ fn rpds_red_black_tree_map_sync_iterate(c: &mut Criterion) {
for kv in map.iter() {
black_box(kv);
}
})
});
});
}

Expand Down
9 changes: 5 additions & 4 deletions benches/rpds_vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn rpds_vector_push_back(c: &mut Criterion) {
}

vector
})
});
});
}

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

vector
})
});
});
}

Expand Down Expand Up @@ -104,10 +104,11 @@ fn rpds_vector_get(c: &mut Criterion) {
for i in 0..limit {
black_box(vector.get(i));
}
})
});
});
}

#[allow(clippy::explicit_iter_loop)]
fn rpds_vector_iterate(c: &mut Criterion) {
let limit = 100_000;
let mut vector: Vector<usize> = Vector::new();
Expand All @@ -121,7 +122,7 @@ fn rpds_vector_iterate(c: &mut Criterion) {
for i in vector.iter() {
black_box(i);
}
})
});
});
}

Expand Down
Loading

0 comments on commit e3bc9c4

Please sign in to comment.