mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +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
|
@ -497,10 +497,9 @@ impl server::Literal for Rustc {
|
|||
}
|
||||
|
||||
fn integer(&mut self, n: &str) -> Self::Literal {
|
||||
let n = if let Ok(n) = n.parse::<i128>() {
|
||||
n.to_string()
|
||||
} else {
|
||||
n.parse::<u128>().unwrap().to_string()
|
||||
let n = match n.parse::<i128>() {
|
||||
Ok(n) => n.to_string(),
|
||||
Err(_) => n.parse::<u128>().unwrap().to_string(),
|
||||
};
|
||||
Literal { text: n.into(), id: tt::TokenId::unspecified() }
|
||||
}
|
||||
|
|
|
@ -500,10 +500,9 @@ impl server::Literal for Rustc {
|
|||
}
|
||||
|
||||
fn integer(&mut self, n: &str) -> Self::Literal {
|
||||
let n = if let Ok(n) = n.parse::<i128>() {
|
||||
n.to_string()
|
||||
} else {
|
||||
n.parse::<u128>().unwrap().to_string()
|
||||
let n = match n.parse::<i128>() {
|
||||
Ok(n) => n.to_string(),
|
||||
Err(_) => n.parse::<u128>().unwrap().to_string(),
|
||||
};
|
||||
Literal { text: n.into(), id: tt::TokenId::unspecified() }
|
||||
}
|
||||
|
|
|
@ -504,10 +504,9 @@ impl server::Literal for Rustc {
|
|||
}
|
||||
|
||||
fn integer(&mut self, n: &str) -> Self::Literal {
|
||||
let n = if let Ok(n) = n.parse::<i128>() {
|
||||
n.to_string()
|
||||
} else {
|
||||
n.parse::<u128>().unwrap().to_string()
|
||||
let n = match n.parse::<i128>() {
|
||||
Ok(n) => n.to_string(),
|
||||
Err(_) => n.parse::<u128>().unwrap().to_string(),
|
||||
};
|
||||
Literal { text: n.into(), id: tt::TokenId::unspecified() }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue