Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jneem committed Sep 27, 2024
1 parent 2493e85 commit ec4a3a0
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions core/src/term/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl ArrayAttrs {
/// delimited by `start` (included) and `end` (excluded). This allows to take the tail of an array,
/// or an arbitrary slice, in constant time, providing actual linear time iteration when
/// imlementing recursive functions, such as folds, for example.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Default)]
pub struct Array {
inner: rpds::Vector<RichTerm>,
start: usize,
Expand Down Expand Up @@ -96,11 +96,11 @@ impl Array {
}

/// Returns an iterator of references over the array.
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a RichTerm> + 'a {
pub fn iter(&self) -> impl Iterator<Item = &'_ RichTerm> + '_ {
self.inner.iter().rev().skip(self.start).take(self.len())
}

pub fn iter_rev<'a>(&'a self) -> impl Iterator<Item = &'a RichTerm> + 'a {
pub fn iter_rev(&self) -> impl Iterator<Item = &'_ RichTerm> + '_ {
self.inner
.iter()
.skip(self.inner.len() - self.end)
Expand Down Expand Up @@ -129,16 +129,6 @@ impl Array {
}
}

impl Default for Array {
fn default() -> Self {
Self {
inner: rpds::Vector::default(),
start: 0,
end: 0,
}
}
}

impl FromIterator<RichTerm> for Array {
fn from_iter<T: IntoIterator<Item = RichTerm>>(iter: T) -> Self {
// Ugh. rpds::Vector doesn't support reverse-in-place
Expand Down

0 comments on commit ec4a3a0

Please sign in to comment.