mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-19 01:50:32 +00:00
Remove some redundant allocations
This commit is contained in:
parent
479d1f7eec
commit
26a1675764
10 changed files with 9 additions and 10 deletions
|
@ -55,7 +55,7 @@ impl ast::Attr {
|
|||
let key = self.simple_name()?;
|
||||
let value_token = lit.syntax().first_token()?;
|
||||
|
||||
let value: SmolStr = ast::String::cast(value_token.clone())?.value()?.into();
|
||||
let value: SmolStr = ast::String::cast(value_token)?.value()?.into();
|
||||
|
||||
Some((key, value))
|
||||
}
|
||||
|
|
|
@ -599,7 +599,7 @@ impl ast::IntNumber {
|
|||
text = &text[radix.prefix_len()..];
|
||||
|
||||
let buf;
|
||||
if text.contains("_") {
|
||||
if text.contains('_') {
|
||||
buf = text.replace('_', "");
|
||||
text = buf.as_str();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue