From 407f85c19bda3a0e53741df1ba5333ee9138badf Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 20 Jul 2022 19:18:46 +0200 Subject: [PATCH] Consistently use 'Self' type in 'impl' blocks --- src/board/file.rs | 20 ++++++++++---------- src/board/rank.rs | 20 ++++++++++---------- src/board/square.rs | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/board/file.rs b/src/board/file.rs index fa7ba15..1601397 100644 --- a/src/board/file.rs +++ b/src/board/file.rs @@ -15,19 +15,19 @@ pub enum File { } impl File { - const ALL: [File; 8] = [ - File::A, - File::B, - File::C, - File::D, - File::E, - File::F, - File::G, - File::H, + const ALL: [Self; 8] = [ + Self::A, + Self::B, + Self::C, + Self::D, + Self::E, + Self::F, + Self::G, + Self::H, ]; /// Iterate over all files in order. - pub fn iter() -> impl Iterator { + pub fn iter() -> impl Iterator { Self::ALL.iter().cloned() } diff --git a/src/board/rank.rs b/src/board/rank.rs index 59374c7..c679278 100644 --- a/src/board/rank.rs +++ b/src/board/rank.rs @@ -15,19 +15,19 @@ pub enum Rank { } impl Rank { - const ALL: [Rank; 8] = [ - Rank::First, - Rank::Second, - Rank::Third, - Rank::Fourth, - Rank::Fifth, - Rank::Sixth, - Rank::Seventh, - Rank::Eighth, + const ALL: [Self; 8] = [ + Self::First, + Self::Second, + Self::Third, + Self::Fourth, + Self::Fifth, + Self::Sixth, + Self::Seventh, + Self::Eighth, ]; /// Iterate over all ranks in order. - pub fn iter() -> impl Iterator { + pub fn iter() -> impl Iterator { Self::ALL.iter().cloned() } diff --git a/src/board/square.rs b/src/board/square.rs index 69d8167..9c0178e 100644 --- a/src/board/square.rs +++ b/src/board/square.rs @@ -43,7 +43,7 @@ impl Square { } /// Iterate over all squares in order. - pub fn iter() -> impl Iterator { + pub fn iter() -> impl Iterator { Self::ALL.iter().cloned() }