Skip to content

style: resole clippy issues #718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/data_structures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod b_tree;
mod binary_search_tree;
mod fenwick_tree;
mod floyds_algorithm;
mod graph;
pub mod graph;
mod hash_table;
mod heap;
mod infix_to_postfix;
Expand Down
2 changes: 1 addition & 1 deletion src/data_structures/probabilistic/bloom_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::hash::{BuildHasher, Hash, Hasher};

/// A Bloom Filter <https://en.wikipedia.org/wiki/Bloom_filter> is a probabilistic data structure testing whether an element belongs to a set or not
/// Therefore, its contract looks very close to the one of a set, for example a `HashSet`
trait BloomFilter<Item: Hash> {
pub trait BloomFilter<Item: Hash> {
fn insert(&mut self, item: Item);
fn contains(&self, item: &Item) -> bool;
}
Expand Down
2 changes: 1 addition & 1 deletion src/graph/floyd_warshall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn floyd_warshall<V: Ord + Copy, E: Ord + Copy + Add<Output = E> + num_trait
let keys = map.keys().copied().collect::<Vec<_>>();
for &k in &keys {
for &i in &keys {
if map[&i].get(&k).is_none() {
if !map[&i].contains_key(&k) {
continue;
}
for &j in &keys {
Expand Down
6 changes: 6 additions & 0 deletions src/math/linear_sieve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ impl LinearSieve {
}
}

impl Default for LinearSieve {
fn default() -> Self {
Self::new()
}
}

#[cfg(test)]
mod tests {
use super::LinearSieve;
Expand Down
9 changes: 0 additions & 9 deletions src/math/trig_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,6 @@ mod tests {

const TOL: f64 = 1e-10;

trait Verify {
fn verify<T: Into<f64> + Copy>(
trig_func: &TrigFuncType,
angle: T,
expected_result: f64,
is_radian: bool,
);
}

impl TrigFuncType {
fn verify<T: Into<f64> + Copy>(&self, angle: T, expected_result: f64, is_radian: bool) {
let value = match self {
Expand Down