Satisfy clippy.

This commit is contained in:
Stephen Chung
2021-07-24 14:11:16 +08:00
parent b8485b1909
commit df482d3574
32 changed files with 226 additions and 367 deletions

View File

@@ -77,16 +77,9 @@ impl ModuleResolversCollection {
}
/// Get an iterator of all the [module resolvers][ModuleResolver].
#[inline(always)]
#[must_use]
pub fn iter(&self) -> impl Iterator<Item = &dyn ModuleResolver> {
self.0.iter().map(|v| v.as_ref())
}
/// Get a mutable iterator of all the [module resolvers][ModuleResolver].
#[inline(always)]
#[must_use]
pub fn into_iter(self) -> impl Iterator<Item = Box<dyn ModuleResolver>> {
self.0.into_iter()
}
/// Remove all [module resolvers][ModuleResolver].
#[inline(always)]
pub fn clear(&mut self) -> &mut Self {
@@ -114,6 +107,16 @@ impl ModuleResolversCollection {
}
}
impl IntoIterator for ModuleResolversCollection {
type Item = Box<dyn ModuleResolver>;
type IntoIter = std::vec::IntoIter<Box<dyn ModuleResolver>>;
#[inline(always)]
fn into_iter(self) -> Self::IntoIter {
self.0.into_iter()
}
}
impl ModuleResolver for ModuleResolversCollection {
fn resolve(
&self,