Skip to content

Commit a097ffe

Browse files
authored
style: resole clippy issues (#718)
1 parent 1020ea2 commit a097ffe

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

src/data_structures/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod b_tree;
33
mod binary_search_tree;
44
mod fenwick_tree;
55
mod floyds_algorithm;
6-
mod graph;
6+
pub mod graph;
77
mod hash_table;
88
mod heap;
99
mod infix_to_postfix;

src/data_structures/probabilistic/bloom_filter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::hash::{BuildHasher, Hash, Hasher};
33

44
/// 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
55
/// Therefore, its contract looks very close to the one of a set, for example a `HashSet`
6-
trait BloomFilter<Item: Hash> {
6+
pub trait BloomFilter<Item: Hash> {
77
fn insert(&mut self, item: Item);
88
fn contains(&self, item: &Item) -> bool;
99
}

src/graph/floyd_warshall.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn floyd_warshall<V: Ord + Copy, E: Ord + Copy + Add<Output = E> + num_trait
3636
let keys = map.keys().copied().collect::<Vec<_>>();
3737
for &k in &keys {
3838
for &i in &keys {
39-
if map[&i].get(&k).is_none() {
39+
if !map[&i].contains_key(&k) {
4040
continue;
4141
}
4242
for &j in &keys {

src/math/linear_sieve.rs

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ impl LinearSieve {
7676
}
7777
}
7878

79+
impl Default for LinearSieve {
80+
fn default() -> Self {
81+
Self::new()
82+
}
83+
}
84+
7985
#[cfg(test)]
8086
mod tests {
8187
use super::LinearSieve;

src/math/trig_functions.rs

-9
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,6 @@ mod tests {
154154

155155
const TOL: f64 = 1e-10;
156156

157-
trait Verify {
158-
fn verify<T: Into<f64> + Copy>(
159-
trig_func: &TrigFuncType,
160-
angle: T,
161-
expected_result: f64,
162-
is_radian: bool,
163-
);
164-
}
165-
166157
impl TrigFuncType {
167158
fn verify<T: Into<f64> + Copy>(&self, angle: T, expected_result: f64, is_radian: bool) {
168159
let value = match self {

0 commit comments

Comments
 (0)