Skip to content

Commit

Permalink
#4 rename
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Apr 16, 2023
1 parent 118fbf0 commit 1dab298
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ pub struct Map<K: Copy + PartialEq, V: Clone, const N: usize> {
}

/// Iterator over the `Map`.
pub struct MapIter<'a, K, V, const N: usize> {
pub struct Iter<'a, K, V, const N: usize> {
pos: usize,
pairs: &'a [Pair<K, V>; N],
}

/// Into-iterator over the `Map`.
pub struct MapIntoIter<'a, K, V, const N: usize> {
pub struct IntoIter<'a, K, V, const N: usize> {
pos: usize,
pairs: &'a [Pair<K, V>; N],
}
Expand Down
18 changes: 9 additions & 9 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
// SOFTWARE.

use crate::Pair::{Absent, Present};
use crate::{Map, MapIntoIter, MapIter, Pair};
use crate::{IntoIter, Iter, Map, Pair};

impl<'a, K: Clone, V: Clone, const N: usize> Iterator for MapIter<'a, K, V, N> {
impl<'a, K: Clone, V: Clone, const N: usize> Iterator for Iter<'a, K, V, N> {
type Item = (&'a K, &'a V);

#[inline]
Expand All @@ -38,7 +38,7 @@ impl<'a, K: Clone, V: Clone, const N: usize> Iterator for MapIter<'a, K, V, N> {
}
}

impl<'a, K: Clone, V: Clone, const N: usize> Iterator for MapIntoIter<'a, K, V, N> {
impl<'a, K: Clone, V: Clone, const N: usize> Iterator for IntoIter<'a, K, V, N> {
type Item = (K, V);

#[inline]
Expand All @@ -58,11 +58,11 @@ impl<'a, K: Clone, V: Clone, const N: usize> Iterator for MapIntoIter<'a, K, V,

impl<'a, K: Copy + PartialEq, V: Clone, const N: usize> IntoIterator for &'a Map<K, V, N> {
type Item = (K, V);
type IntoIter = MapIntoIter<'a, K, V, N>;
type IntoIter = IntoIter<'a, K, V, N>;

#[inline]
fn into_iter(self) -> Self::IntoIter {
MapIntoIter {
IntoIter {
pos: 0,
pairs: &self.pairs,
}
Expand All @@ -88,8 +88,8 @@ impl<K: Copy + PartialEq, V: Clone, const N: usize> Map<K, V, N> {
/// Make an iterator over all pairs.
#[inline]
#[must_use]
pub const fn iter(&self) -> MapIter<K, V, N> {
MapIter {
pub const fn iter(&self) -> Iter<K, V, N> {
Iter {
pos: 0,
pairs: &self.pairs,
}
Expand All @@ -98,8 +98,8 @@ impl<K: Copy + PartialEq, V: Clone, const N: usize> Map<K, V, N> {
/// Make an iterator over all pairs.
#[inline]
#[must_use]
pub const fn into_iter(&self) -> MapIntoIter<K, V, N> {
MapIntoIter {
pub const fn into_iter(&self) -> IntoIter<K, V, N> {
IntoIter {
pos: 0,
pairs: &self.pairs,
}
Expand Down

0 comments on commit 1dab298

Please sign in to comment.