diff --git a/compiler/module/src/ident.rs b/compiler/module/src/ident.rs index 622ac062ac..1219637ecc 100644 --- a/compiler/module/src/ident.rs +++ b/compiler/module/src/ident.rs @@ -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), diff --git a/compiler/reporting/src/error/type.rs b/compiler/reporting/src/error/type.rs index 5c8d059768..c4a386c169 100644 --- a/compiler/reporting/src/error/type.rs +++ b/compiler/reporting/src/error/type.rs @@ -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) { diff --git a/compiler/types/src/pretty_print.rs b/compiler/types/src/pretty_print.rs index eb6c918999..053248f67e 100644 --- a/compiler/types/src/pretty_print.rs +++ b/compiler/types/src/pretty_print.rs @@ -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(' ');