mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-27 13:54:55 +00:00
Apply let-else statements
This commit is contained in:
parent
cc084b4fec
commit
f979d8dbc3
1 changed files with 2 additions and 6 deletions
|
@ -17,9 +17,7 @@ fn main() -> anyhow::Result<()> {
|
|||
}
|
||||
|
||||
fn requires_lalrpop(source: &str, target: &str) -> Option<String> {
|
||||
let target = if let Ok(target) = File::open(target) {
|
||||
target
|
||||
} else {
|
||||
let Ok(target) = File::open(target) else {
|
||||
return Some("python.rs doesn't exist. regenerate.".to_owned());
|
||||
};
|
||||
|
||||
|
@ -71,9 +69,7 @@ fn requires_lalrpop(source: &str, target: &str) -> Option<String> {
|
|||
}
|
||||
|
||||
fn try_lalrpop(source: &str, target: &str) -> anyhow::Result<()> {
|
||||
let _message = if let Some(msg) = requires_lalrpop(source, target) {
|
||||
msg
|
||||
} else {
|
||||
let Some(_message) = requires_lalrpop(source, target) else {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue