Skip to content

Commit

Permalink
fix clippy::use_self
Browse files Browse the repository at this point in the history
  • Loading branch information
hellow554 committed Jan 10, 2024
1 parent 791bffb commit afec10a
Show file tree
Hide file tree
Showing 16 changed files with 117 additions and 117 deletions.
2 changes: 1 addition & 1 deletion benches/extra/zipslices.rs
Expand Up @@ -58,7 +58,7 @@ where
#[inline(always)]
pub fn from_slices(a: T, b: U) -> Self {
let minl = cmp::min(a.len(), b.len());
ZipSlices {
Self {
t: a,
u: b,
len: minl,
Expand Down
4 changes: 2 additions & 2 deletions examples/iris.rs
Expand Up @@ -25,7 +25,7 @@ enum ParseError {

impl From<ParseFloatError> for ParseError {
fn from(err: ParseFloatError) -> Self {
ParseError::Numeric(err)
Self::Numeric(err)
}
}

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

fn from_str(s: &str) -> Result<Self, Self::Err> {
let mut iris = Iris {
let mut iris = Self {
name: "".into(),
data: [0.; 4],
};
Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/mod.rs
Expand Up @@ -218,7 +218,7 @@ where
/// Split the `PutBack` into its parts.
#[inline]
pub fn into_parts(self) -> (Option<I::Item>, I) {
let PutBack { top, iter } = self;
let Self { top, iter } = self;
(top, iter)
}

Expand Down Expand Up @@ -689,7 +689,7 @@ pub struct Tuple1Combination<I> {

impl<I> From<I> for Tuple1Combination<I> {
fn from(iter: I) -> Self {
Tuple1Combination { iter }
Self { iter }
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/adaptors/multi_product.rs
Expand Up @@ -93,7 +93,7 @@ where

if last.in_progress() {
true
} else if MultiProduct::iterate_last(rest, state) {
} else if Self::iterate_last(rest, state) {
last.reset();
last.iterate();
// If iterator is None twice consecutively, then iterator is
Expand Down Expand Up @@ -133,7 +133,7 @@ where
I::Item: Clone,
{
fn new(iter: I) -> Self {
MultiProductIter {
Self {
cur: None,
iter: iter.clone(),
iter_orig: iter,
Expand Down Expand Up @@ -165,7 +165,7 @@ where
type Item = Vec<I::Item>;

fn next(&mut self) -> Option<Self::Item> {
if MultiProduct::iterate_last(&mut self.0, MultiProductIterState::StartOfIter) {
if Self::iterate_last(&mut self.0, MultiProductIterState::StartOfIter) {
Some(self.curr_iterator())
} else {
None
Expand Down
6 changes: 3 additions & 3 deletions src/duplicates_impl.rs
Expand Up @@ -22,7 +22,7 @@ mod private {

impl<I: Iterator, Key: Eq + Hash, F> DuplicatesBy<I, Key, F> {
pub(crate) fn new(iter: I, key_method: F) -> Self {
DuplicatesBy {
Self {
iter,
meta: Meta {
used: HashMap::new(),
Expand Down Expand Up @@ -77,7 +77,7 @@ mod private {
type Item = I::Item;

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

Expand Down Expand Up @@ -109,7 +109,7 @@ mod private {
F: KeyMethod<Key, I::Item>,
{
fn next_back(&mut self) -> Option<Self::Item> {
let DuplicatesBy { iter, meta } = self;
let Self { iter, meta } = self;
iter.rev().find_map(|v| meta.filter(v))
}
}
Expand Down

0 comments on commit afec10a

Please sign in to comment.