mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Merge branch 'trunk' into builtin-count-graphemes
This commit is contained in:
commit
74b09605a7
35 changed files with 1640 additions and 251 deletions
|
@ -23,6 +23,10 @@ pub struct Lowercase(InlinableString);
|
|||
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub struct Uppercase(InlinableString);
|
||||
|
||||
/// A string representing a foreign (linked-in) symbol
|
||||
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
|
||||
pub struct ForeignSymbol(InlinableString);
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub enum TagName {
|
||||
/// Global tags have no module, but tend to be short strings (since they're
|
||||
|
@ -125,6 +129,28 @@ impl<'a> Into<Box<str>> for ModuleName {
|
|||
}
|
||||
}
|
||||
|
||||
impl ForeignSymbol {
|
||||
pub fn as_str(&self) -> &str {
|
||||
&*self.0
|
||||
}
|
||||
|
||||
pub fn as_inline_str(&self) -> &InlinableString {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for ForeignSymbol {
|
||||
fn from(string: &'a str) -> Self {
|
||||
Self(string.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<String> for ForeignSymbol {
|
||||
fn from(string: String) -> Self {
|
||||
Self(string.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl Uppercase {
|
||||
pub fn as_str(&self) -> &str {
|
||||
&*self.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue