mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-31 09:07:21 +00:00
Refactor package_qualified_imported_modules in load
This commit is contained in:
parent
eea2196c30
commit
9df5fb7092
2 changed files with 13 additions and 13 deletions
|
@ -462,6 +462,15 @@ impl<'a, T> PackageQualified<'a, T> {
|
|||
PackageQualified::Qualified(_, name) => name,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn map_module<B>(&self, f: impl FnOnce(&T) -> B) -> PackageQualified<'a, B> {
|
||||
match self {
|
||||
PackageQualified::Unqualified(name) => PackageQualified::Unqualified(f(name)),
|
||||
PackageQualified::Qualified(package, name) => {
|
||||
PackageQualified::Qualified(package, f(name))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue