mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Remove Name::to_smol_str
This commit is contained in:
parent
df5f1777b8
commit
2346a80ab4
54 changed files with 288 additions and 190 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue