Add checks for is_empty.

This commit is contained in:
Stephen Chung
2022-03-03 13:02:57 +08:00
parent 83755bf936
commit 0e9a16e437
18 changed files with 202 additions and 110 deletions

View File

@@ -62,7 +62,11 @@ impl StaticModuleResolver {
#[inline(always)]
#[must_use]
pub fn contains_path(&self, path: &str) -> bool {
self.0.contains_key(path)
if !self.0.is_empty() {
self.0.contains_key(path)
} else {
false
}
}
/// Get an iterator of all the [modules][Module].
#[inline]