mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
minor: Make use of some new SmolStr
improvements
This commit is contained in:
parent
0bdbf497b6
commit
83591268ab
18 changed files with 80 additions and 61 deletions
|
@ -81,7 +81,7 @@ use rustc_hash::FxHashSet;
|
|||
use stdx::{impl_from, never};
|
||||
use syntax::{
|
||||
ast::{self, HasAttrs as _, HasName},
|
||||
AstNode, AstPtr, SmolStr, SyntaxNode, SyntaxNodePtr, TextRange, T,
|
||||
format_smolstr, AstNode, AstPtr, SmolStr, SyntaxNode, SyntaxNodePtr, TextRange, T,
|
||||
};
|
||||
use triomphe::Arc;
|
||||
|
||||
|
@ -4284,9 +4284,9 @@ impl Type {
|
|||
.filter_map(|arg| {
|
||||
// arg can be either a `Ty` or `constant`
|
||||
if let Some(ty) = arg.ty(Interner) {
|
||||
Some(SmolStr::new(ty.display(db).to_string()))
|
||||
Some(format_smolstr!("{}", ty.display(db)))
|
||||
} else if let Some(const_) = arg.constant(Interner) {
|
||||
Some(SmolStr::new_inline(&const_.display(db).to_string()))
|
||||
Some(format_smolstr!("{}", const_.display(db)))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue