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

@@ -64,33 +64,28 @@ impl StaticModuleResolver {
}
/// Get an iterator of all the [modules][Module].
#[inline(always)]
#[must_use]
pub fn iter(&self) -> impl Iterator<Item = (&str, &Shared<Module>)> {
self.0.iter().map(|(k, v)| (k.as_str(), v))
}
/// Get a mutable iterator of all the [modules][Module].
#[inline(always)]
#[must_use]
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&str, &mut Shared<Module>)> {
self.0.iter_mut().map(|(k, v)| (k.as_str(), v))
}
/// Get a mutable iterator of all the modules.
#[inline(always)]
#[must_use]
pub fn into_iter(self) -> impl Iterator<Item = (Identifier, Shared<Module>)> {
self.0.into_iter()
}
/// Get an iterator of all the [module][Module] paths.
#[inline(always)]
#[must_use]
pub fn paths(&self) -> impl Iterator<Item = &str> {
self.0.keys().map(|s| s.as_str())
}
/// Get an iterator of all the [modules][Module].
#[inline(always)]
#[must_use]
pub fn values(&self) -> impl Iterator<Item = &Shared<Module>> {
self.0.values().map(|m| m)
self.0.values()
}
/// Remove all [modules][Module].
#[inline(always)]