mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
cleanup fetching module docs
This commit is contained in:
parent
45237c2aa0
commit
3fe3a3439a
2 changed files with 32 additions and 55 deletions
|
@ -78,6 +78,31 @@ pub enum HeaderType<'a> {
|
|||
exposes: &'a [Loc<ExposedName<'a>>],
|
||||
},
|
||||
}
|
||||
impl<'a> HeaderType<'a> {
|
||||
pub fn get_name(self) -> Option<&'a str> {
|
||||
match self {
|
||||
Self::Interface { name, .. }
|
||||
| Self::Builtin { name, .. }
|
||||
| Self::Hosted { name, .. } => Some(name.into()),
|
||||
Self::App {
|
||||
output_name: StrLiteral::PlainLine(name),
|
||||
..
|
||||
}
|
||||
| Self::Platform {
|
||||
config_shorthand: name,
|
||||
..
|
||||
}
|
||||
| Self::Package {
|
||||
config_shorthand: name,
|
||||
..
|
||||
} => Some(name),
|
||||
Self::App { .. } => {
|
||||
//TODO:Eli This can be removed once module params is implimented and app names are no longer strings
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
||||
pub enum Version<'a> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue