mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Replace TagName::into_string with as_string
This commit is contained in:
parent
c5f5bb1bef
commit
181cf10d2c
3 changed files with 7 additions and 7 deletions
|
@ -40,7 +40,7 @@ pub enum TagName {
|
|||
}
|
||||
|
||||
impl TagName {
|
||||
pub fn into_string(self, interns: &Interns, home: ModuleId) -> InlinableString {
|
||||
pub fn as_string(&self, interns: &Interns, home: ModuleId) -> InlinableString {
|
||||
match self {
|
||||
TagName::Global(uppercase) => uppercase.as_inline_str().clone(),
|
||||
TagName::Private(symbol) => symbol.fully_qualified(interns, home),
|
||||
|
|
|
@ -2302,9 +2302,9 @@ fn type_problem_to_pretty<'b>(
|
|||
TagTypo(typo, possibilities_tn) => {
|
||||
let possibilities = possibilities_tn
|
||||
.into_iter()
|
||||
.map(|tag_name| tag_name.into_string(alloc.interns, alloc.home))
|
||||
.map(|tag_name| tag_name.as_string(alloc.interns, alloc.home))
|
||||
.collect();
|
||||
let typo_str = format!("{}", typo.into_string(alloc.interns, alloc.home));
|
||||
let typo_str = format!("{}", typo.as_string(alloc.interns, alloc.home));
|
||||
let suggestions = suggest::sort(&typo_str, possibilities);
|
||||
|
||||
match suggestions.get(0) {
|
||||
|
|
|
@ -467,8 +467,8 @@ fn write_flat_type(env: &Env, flat_type: FlatType, subs: &Subs, buf: &mut String
|
|||
|
||||
sorted_fields.sort_by(|(a, _), (b, _)| {
|
||||
a.clone()
|
||||
.into_string(interns, home)
|
||||
.cmp(&b.clone().into_string(&interns, home))
|
||||
.as_string(interns, home)
|
||||
.cmp(&b.as_string(&interns, home))
|
||||
});
|
||||
|
||||
let mut any_written_yet = false;
|
||||
|
@ -480,7 +480,7 @@ fn write_flat_type(env: &Env, flat_type: FlatType, subs: &Subs, buf: &mut String
|
|||
any_written_yet = true;
|
||||
}
|
||||
|
||||
buf.push_str(&label.into_string(&interns, home));
|
||||
buf.push_str(&label.as_string(&interns, home));
|
||||
|
||||
for var in vars {
|
||||
buf.push(' ');
|
||||
|
@ -533,7 +533,7 @@ fn write_flat_type(env: &Env, flat_type: FlatType, subs: &Subs, buf: &mut String
|
|||
} else {
|
||||
any_written_yet = true;
|
||||
}
|
||||
buf.push_str(&label.into_string(&interns, home));
|
||||
buf.push_str(&label.as_string(&interns, home));
|
||||
|
||||
for var in vars {
|
||||
buf.push(' ');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue