Remove Name::to_smol_str

This commit is contained in:
Lukas Wirth 2024-07-16 12:43:58 +02:00
parent df5f1777b8
commit 2346a80ab4
54 changed files with 288 additions and 190 deletions

View file

@ -1,7 +1,10 @@
//! Functionality for generating trivial constructors
use hir::StructKind;
use syntax::ast::{make, Expr, Path};
use syntax::{
ast::{make, Expr, Path},
ToSmolStr,
};
/// given a type return the trivial constructor (if one exists)
pub fn use_trivial_constructor(
@ -15,7 +18,9 @@ pub fn use_trivial_constructor(
if variant.kind(db) == hir::StructKind::Unit {
let path = make::path_qualified(
path,
make::path_segment(make::name_ref(&variant.name(db).to_smol_str())),
make::path_segment(make::name_ref(
&variant.name(db).display_no_db().to_smolstr(),
)),
);
return Some(make::expr_path(path));