mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Use SmolStr for the type text
This commit is contained in:
parent
d32774b464
commit
25398ad30d
1 changed files with 6 additions and 3 deletions
|
@ -18,7 +18,7 @@ pub struct InlayHint {
|
||||||
pub range: TextRange,
|
pub range: TextRange,
|
||||||
pub text: SmolStr,
|
pub text: SmolStr,
|
||||||
pub inlay_kind: InlayKind,
|
pub inlay_kind: InlayKind,
|
||||||
pub inlay_type_string: String,
|
pub inlay_type_string: SmolStr,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn inlay_hints(db: &RootDatabase, file_id: FileId, file: &SourceFile) -> Vec<InlayHint> {
|
pub(crate) fn inlay_hints(db: &RootDatabase, file_id: FileId, file: &SourceFile) -> Vec<InlayHint> {
|
||||||
|
@ -45,7 +45,8 @@ fn get_inlay_hints(
|
||||||
let let_pat = let_statement.pat()?;
|
let let_pat = let_statement.pat()?;
|
||||||
let inlay_type_string = get_node_displayable_type(db, file_id, let_syntax, &let_pat)?
|
let inlay_type_string = get_node_displayable_type(db, file_id, let_syntax, &let_pat)?
|
||||||
.display(db)
|
.display(db)
|
||||||
.to_string();;
|
.to_string()
|
||||||
|
.into();
|
||||||
|
|
||||||
let pat_range = match let_pat.kind() {
|
let pat_range = match let_pat.kind() {
|
||||||
PatKind::BindPat(bind_pat) => bind_pat.syntax().text_range(),
|
PatKind::BindPat(bind_pat) => bind_pat.syntax().text_range(),
|
||||||
|
@ -74,7 +75,9 @@ fn get_inlay_hints(
|
||||||
&closure_param.pat()?,
|
&closure_param.pat()?,
|
||||||
)?
|
)?
|
||||||
.display(db)
|
.display(db)
|
||||||
.to_string();
|
.to_string()
|
||||||
|
.into();
|
||||||
|
|
||||||
Some(InlayHint {
|
Some(InlayHint {
|
||||||
range: closure_param_syntax.text_range(),
|
range: closure_param_syntax.text_range(),
|
||||||
text: closure_param_syntax.text().to_string().into(),
|
text: closure_param_syntax.text().to_string().into(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue