Skip to content

Commit 48087bc

Browse files
committed
tidy for clippy
1 parent 4b845f8 commit 48087bc

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

src/distinct.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ impl<V: Hash> PartialEq for HyperLogLogMagnitude<V> {
8181
impl<V: Hash> Eq for HyperLogLogMagnitude<V> {}
8282
impl<V: Hash> Clone for HyperLogLogMagnitude<V> {
8383
fn clone(&self) -> Self {
84-
HyperLogLogMagnitude(self.0.clone())
84+
Self(self.0.clone())
8585
}
8686
}
8787
impl<V: Hash> New for HyperLogLogMagnitude<V> {
8888
type Config = f64;
8989
fn new(config: &Self::Config) -> Self {
90-
HyperLogLogMagnitude(New::new(config))
90+
Self(New::new(config))
9191
}
9292
}
9393
impl<V: Hash> Intersect for HyperLogLogMagnitude<V> {
9494
fn intersect<'a>(iter: impl Iterator<Item = &'a Self>) -> Option<Self>
9595
where
9696
Self: Sized + 'a,
9797
{
98-
Intersect::intersect(iter.map(|x| &x.0)).map(HyperLogLogMagnitude)
98+
Intersect::intersect(iter.map(|x| &x.0)).map(Self)
9999
}
100100
}
101101
impl<'a, V: Hash> UnionAssign<&'a HyperLogLogMagnitude<V>> for HyperLogLogMagnitude<V> {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
dead_code,
4040
clippy::doc_markdown,
4141
clippy::inline_always,
42-
clippy::stutter,
42+
clippy::module_name_repetitions,
4343
clippy::if_not_else,
4444
clippy::op_ref,
4545
clippy::needless_pass_by_value,

src/ordered_linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl<'a> OrderedLinkedListIndex<'a> {
1515
pub struct OrderedLinkedList<T>(LinkedList<T>);
1616
impl<T: Ord> OrderedLinkedList<T> {
1717
pub fn new(cap: usize) -> Self {
18-
OrderedLinkedList(LinkedList::new(cap))
18+
Self(LinkedList::new(cap))
1919
}
2020
fn assert(&self) {
2121
if !cfg!(feature = "assert") {

src/sample.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl Drop for SampleTotal {
4242
struct FixedCapVec<T>(Vec<T>);
4343
impl<T> FixedCapVec<T> {
4444
fn new(cap: usize) -> Self {
45-
let self_ = FixedCapVec(Vec::with_capacity(cap));
45+
let self_ = Self(Vec::with_capacity(cap));
4646
assert_eq!(self_.capacity(), cap);
4747
self_
4848
}
@@ -115,7 +115,7 @@ where
115115
<(usize, Vec<T>)>::deserialize(deserializer).map(|(cap, mut vec)| {
116116
vec.reserve_exact(cap - vec.len());
117117
assert_eq!(vec.capacity(), cap);
118-
FixedCapVec(vec)
118+
Self(vec)
119119
})
120120
}
121121
}

src/top.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,9 @@ impl<T, C: Eq> Eq for Node<T, C> {}
302302
#[cfg(test)]
303303
mod test {
304304
use super::*;
305-
use distinct::HyperLogLog;
305+
use crate::{distinct::HyperLogLog, traits::IntersectPlusUnionIsPlus};
306306
use rand::{self, Rng, SeedableRng};
307307
use std::time;
308-
use traits::IntersectPlusUnionIsPlus;
309308

310309
#[test]
311310
fn abc() {
@@ -355,21 +354,21 @@ mod test {
355354
impl<V: Hash> Eq for HLL<V> {}
356355
impl<V: Hash> Clone for HLL<V> {
357356
fn clone(&self) -> Self {
358-
HLL(self.0.clone())
357+
Self(self.0.clone())
359358
}
360359
}
361360
impl<V: Hash> New for HLL<V> {
362361
type Config = f64;
363362
fn new(config: &Self::Config) -> Self {
364-
HLL(New::new(config))
363+
Self(New::new(config))
365364
}
366365
}
367366
impl<V: Hash> Intersect for HLL<V> {
368367
fn intersect<'a>(iter: impl Iterator<Item = &'a Self>) -> Option<Self>
369368
where
370369
Self: Sized + 'a,
371370
{
372-
Intersect::intersect(iter.map(|x| &x.0)).map(HLL)
371+
Intersect::intersect(iter.map(|x| &x.0)).map(Self)
373372
}
374373
}
375374
impl<'a, V: Hash> UnionAssign<&'a HLL<V>> for HLL<V> {

0 commit comments

Comments
 (0)