Skip to content

Commit

Permalink
iter: 🔨 rename ContdIter to Contd
Browse files Browse the repository at this point in the history
  • Loading branch information
cratelyn committed Jul 18, 2024
1 parent 36c5299 commit 06455ef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ pub trait Limited: Iterator + Sized {
}

/// the type of iterator returned by [`Limited::contd()`].
type ContdIter: IntoIterator<Item = Self::Item>;
type Contd: IntoIterator<Item = Self::Item>;

/// returns an iterator of values to use as an indication of truncation.
///
/// e.g. for strings, represented as an iterator of characters, one might use `"..."`.
fn contd() -> Self::ContdIter;
fn contd() -> Self::Contd;

/// defines the size of an item in this iterator.
///
Expand Down
4 changes: 2 additions & 2 deletions src/str/trim_to_length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ where
LimitedIter::new(self, size)
}

type ContdIter = std::str::Chars<'static>;
type Contd = std::str::Chars<'static>;

fn contd() -> Self::ContdIter {
fn contd() -> Self::Contd {
E::ellipsis().chars()
}

Expand Down
4 changes: 2 additions & 2 deletions src/str/trim_to_width.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ where
LimitedIter::new(self, size)
}

type ContdIter = std::str::Chars<'static>;
type Contd = std::str::Chars<'static>;

fn contd() -> Self::ContdIter {
fn contd() -> Self::Contd {
E::ellipsis().chars()
}

Expand Down
6 changes: 3 additions & 3 deletions tests/test_char_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ impl<'a> From<Chars<'a>> for TestIter<'a> {
}

impl<'a> Limited for TestIter<'a> {
type ContdIter = std::array::IntoIter<char, 3>;
type Contd = std::str::Chars<'static>;

fn contd() -> Self::ContdIter {
['.', '.', '.'].into_iter()
fn contd() -> Self::Contd {
"...".chars()
}

fn element_size(_: &Self::Item) -> usize {
Expand Down

0 comments on commit 06455ef

Please sign in to comment.