Skip to content

Commit afec10a

Browse files
committed
fix clippy::use_self
1 parent 791bffb commit afec10a

16 files changed

+117
-117
lines changed

benches/extra/zipslices.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ where
5858
#[inline(always)]
5959
pub fn from_slices(a: T, b: U) -> Self {
6060
let minl = cmp::min(a.len(), b.len());
61-
ZipSlices {
61+
Self {
6262
t: a,
6363
u: b,
6464
len: minl,

examples/iris.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ enum ParseError {
2525

2626
impl From<ParseFloatError> for ParseError {
2727
fn from(err: ParseFloatError) -> Self {
28-
ParseError::Numeric(err)
28+
Self::Numeric(err)
2929
}
3030
}
3131

@@ -34,7 +34,7 @@ impl FromStr for Iris {
3434
type Err = ParseError;
3535

3636
fn from_str(s: &str) -> Result<Self, Self::Err> {
37-
let mut iris = Iris {
37+
let mut iris = Self {
3838
name: "".into(),
3939
data: [0.; 4],
4040
};

src/adaptors/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ where
218218
/// Split the `PutBack` into its parts.
219219
#[inline]
220220
pub fn into_parts(self) -> (Option<I::Item>, I) {
221-
let PutBack { top, iter } = self;
221+
let Self { top, iter } = self;
222222
(top, iter)
223223
}
224224

@@ -689,7 +689,7 @@ pub struct Tuple1Combination<I> {
689689

690690
impl<I> From<I> for Tuple1Combination<I> {
691691
fn from(iter: I) -> Self {
692-
Tuple1Combination { iter }
692+
Self { iter }
693693
}
694694
}
695695

src/adaptors/multi_product.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ where
9393

9494
if last.in_progress() {
9595
true
96-
} else if MultiProduct::iterate_last(rest, state) {
96+
} else if Self::iterate_last(rest, state) {
9797
last.reset();
9898
last.iterate();
9999
// If iterator is None twice consecutively, then iterator is
@@ -133,7 +133,7 @@ where
133133
I::Item: Clone,
134134
{
135135
fn new(iter: I) -> Self {
136-
MultiProductIter {
136+
Self {
137137
cur: None,
138138
iter: iter.clone(),
139139
iter_orig: iter,
@@ -165,7 +165,7 @@ where
165165
type Item = Vec<I::Item>;
166166

167167
fn next(&mut self) -> Option<Self::Item> {
168-
if MultiProduct::iterate_last(&mut self.0, MultiProductIterState::StartOfIter) {
168+
if Self::iterate_last(&mut self.0, MultiProductIterState::StartOfIter) {
169169
Some(self.curr_iterator())
170170
} else {
171171
None

src/duplicates_impl.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod private {
2222

2323
impl<I: Iterator, Key: Eq + Hash, F> DuplicatesBy<I, Key, F> {
2424
pub(crate) fn new(iter: I, key_method: F) -> Self {
25-
DuplicatesBy {
25+
Self {
2626
iter,
2727
meta: Meta {
2828
used: HashMap::new(),
@@ -77,7 +77,7 @@ mod private {
7777
type Item = I::Item;
7878

7979
fn next(&mut self) -> Option<Self::Item> {
80-
let DuplicatesBy { iter, meta } = self;
80+
let Self { iter, meta } = self;
8181
iter.find_map(|v| meta.filter(v))
8282
}
8383

@@ -109,7 +109,7 @@ mod private {
109109
F: KeyMethod<Key, I::Item>,
110110
{
111111
fn next_back(&mut self) -> Option<Self::Item> {
112-
let DuplicatesBy { iter, meta } = self;
112+
let Self { iter, meta } = self;
113113
iter.rev().find_map(|v| meta.filter(v))
114114
}
115115
}

0 commit comments

Comments
 (0)