From 2c140d048127569ff6fff57f2b6fa3e066a9a771 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 1a64929..2ff337b 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 a3c783a..16f5144 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 e8588eb..097e49a 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() }