mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Replace if let
with match
where appropriate
This commit is contained in:
parent
f29796da61
commit
9583dd5725
44 changed files with 201 additions and 269 deletions
|
@ -48,10 +48,9 @@ impl Name {
|
|||
|
||||
/// Resolve a name from the text of token.
|
||||
fn resolve(raw_text: &str) -> Name {
|
||||
if let Some(text) = raw_text.strip_prefix("r#") {
|
||||
Name::new_text(SmolStr::new(text))
|
||||
} else {
|
||||
Name::new_text(raw_text.into())
|
||||
match raw_text.strip_prefix("r#") {
|
||||
Some(text) => Name::new_text(SmolStr::new(text)),
|
||||
None => Name::new_text(raw_text.into()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue