From ba0d9d3037ebb559333eed42dfac00030d3522a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Thu, 14 May 2020 22:13:08 +0200 Subject: [PATCH] fix iterator type --- common/src/comp/body/biped_large.rs | 3 +-- common/src/comp/body/bird_medium.rs | 3 +-- common/src/comp/body/critter.rs | 3 +-- common/src/comp/body/dragon.rs | 3 +-- common/src/comp/body/golem.rs | 3 +-- common/src/comp/body/humanoid.rs | 3 +-- common/src/comp/body/quadruped_medium.rs | 3 +-- common/src/comp/body/quadruped_small.rs | 3 +-- 8 files changed, 8 insertions(+), 16 deletions(-) diff --git a/common/src/comp/body/biped_large.rs b/common/src/comp/body/biped_large.rs index 598a15b7fe..6e26f4300e 100644 --- a/common/src/comp/body/biped_large.rs +++ b/common/src/comp/body/biped_large.rs @@ -55,10 +55,9 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies pub const ALL_SPECIES: [Species; 2] = [Species::Ogre, Species::Cyclops]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type IntoIter = std::iter::Copied>; type Item = Species; - type IntoIter = impl Iterator; - fn into_iter(self) -> Self::IntoIter { ALL_SPECIES.iter().copied() } } diff --git a/common/src/comp/body/bird_medium.rs b/common/src/comp/body/bird_medium.rs index 10c7e17966..a66d9f2e0d 100644 --- a/common/src/comp/body/bird_medium.rs +++ b/common/src/comp/body/bird_medium.rs @@ -82,10 +82,9 @@ pub const ALL_SPECIES: [Species; 8] = [ ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type IntoIter = std::iter::Copied>; type Item = Species; - type IntoIter = impl Iterator; - fn into_iter(self) -> Self::IntoIter { ALL_SPECIES.iter().copied() } } diff --git a/common/src/comp/body/critter.rs b/common/src/comp/body/critter.rs index d72145a7e9..6170515512 100644 --- a/common/src/comp/body/critter.rs +++ b/common/src/comp/body/critter.rs @@ -72,10 +72,9 @@ pub const ALL_SPECIES: [Species; 6] = [ ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type IntoIter = std::iter::Copied>; type Item = Species; - type IntoIter = impl Iterator; - fn into_iter(self) -> Self::IntoIter { ALL_SPECIES.iter().copied() } } diff --git a/common/src/comp/body/dragon.rs b/common/src/comp/body/dragon.rs index 3ccb3c6b65..942e80e4e7 100644 --- a/common/src/comp/body/dragon.rs +++ b/common/src/comp/body/dragon.rs @@ -52,10 +52,9 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies pub const ALL_SPECIES: [Species; 1] = [Species::Reddragon]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type IntoIter = std::iter::Copied>; type Item = Species; - type IntoIter = impl Iterator; - fn into_iter(self) -> Self::IntoIter { ALL_SPECIES.iter().copied() } } diff --git a/common/src/comp/body/golem.rs b/common/src/comp/body/golem.rs index 136957aebf..e4f430887b 100644 --- a/common/src/comp/body/golem.rs +++ b/common/src/comp/body/golem.rs @@ -52,10 +52,9 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies pub const ALL_SPECIES: [Species; 1] = [Species::StoneGolem]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type IntoIter = std::iter::Copied>; type Item = Species; - type IntoIter = impl Iterator; - fn into_iter(self) -> Self::IntoIter { ALL_SPECIES.iter().copied() } } diff --git a/common/src/comp/body/humanoid.rs b/common/src/comp/body/humanoid.rs index 91b6c483ef..73eed323cd 100644 --- a/common/src/comp/body/humanoid.rs +++ b/common/src/comp/body/humanoid.rs @@ -105,10 +105,9 @@ pub const ALL_RACES: [Race; 6] = [ ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type IntoIter = std::iter::Copied>; type Item = Race; - type IntoIter = impl Iterator; - fn into_iter(self) -> Self::IntoIter { ALL_RACES.iter().copied() } } diff --git a/common/src/comp/body/quadruped_medium.rs b/common/src/comp/body/quadruped_medium.rs index 8d7a1265ff..d4c310db74 100644 --- a/common/src/comp/body/quadruped_medium.rs +++ b/common/src/comp/body/quadruped_medium.rs @@ -82,10 +82,9 @@ pub const ALL_SPECIES: [Species; 8] = [ ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type IntoIter = std::iter::Copied>; type Item = Species; - type IntoIter = impl Iterator; - fn into_iter(self) -> Self::IntoIter { ALL_SPECIES.iter().copied() } } diff --git a/common/src/comp/body/quadruped_small.rs b/common/src/comp/body/quadruped_small.rs index 51e5376828..b44958ffb1 100644 --- a/common/src/comp/body/quadruped_small.rs +++ b/common/src/comp/body/quadruped_small.rs @@ -102,10 +102,9 @@ pub const ALL_SPECIES: [Species; 13] = [ ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type IntoIter = std::iter::Copied>; type Item = Species; - type IntoIter = impl Iterator; - fn into_iter(self) -> Self::IntoIter { ALL_SPECIES.iter().copied() } }