diff --git a/rust/src/flavour_colours.rs b/rust/src/flavour_colours.rs index 3a1972c..0231d64 100644 --- a/rust/src/flavour_colours.rs +++ b/rust/src/flavour_colours.rs @@ -31,36 +31,39 @@ pub struct FlavourColours { pub crust: Colour, } -impl FlavourColours { +impl IntoIterator for FlavourColours { + type Item = Colour; + type IntoIter = std::array::IntoIter; + /// Returns an iterator over the colours in the flavour. - pub fn into_iter(&self) -> std::array::IntoIter<&Colour, 26> { + fn into_iter(self) -> std::array::IntoIter { [ - &self.rosewater, - &self.flamingo, - &self.pink, - &self.mauve, - &self.red, - &self.maroon, - &self.peach, - &self.yellow, - &self.green, - &self.teal, - &self.sky, - &self.sapphire, - &self.blue, - &self.lavender, - &self.text, - &self.subtext1, - &self.subtext0, - &self.overlay2, - &self.overlay1, - &self.overlay0, - &self.surface2, - &self.surface1, - &self.surface0, - &self.base, - &self.mantle, - &self.crust, + self.rosewater, + self.flamingo, + self.pink, + self.mauve, + self.red, + self.maroon, + self.peach, + self.yellow, + self.green, + self.teal, + self.sky, + self.sapphire, + self.blue, + self.lavender, + self.text, + self.subtext1, + self.subtext0, + self.overlay2, + self.overlay1, + self.overlay0, + self.surface2, + self.surface1, + self.surface0, + self.base, + self.mantle, + self.crust, ] .into_iter() }