clippy: collapse nested ifs into match guards (rust 1.98)
This commit is contained in:
@@ -282,11 +282,9 @@ pub fn read_pyproject(path: &Path) -> Option<PyProject> {
|
|||||||
("project", "description") => project.description = Some(value),
|
("project", "description") => project.description = Some(value),
|
||||||
("project", "license") => project.license = license_text(&value),
|
("project", "license") => project.license = license_text(&value),
|
||||||
("project.urls", "Homepage") => project.homepage = Some(value),
|
("project.urls", "Homepage") => project.homepage = Some(value),
|
||||||
("project.scripts", key) => {
|
("project.scripts", key) if project.script.is_none() => {
|
||||||
if project.script.is_none() {
|
|
||||||
project.script = Some(key.to_string());
|
project.script = Some(key.to_string());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-6
@@ -379,12 +379,10 @@ fn text_inner(
|
|||||||
input.push(c);
|
input.push(c);
|
||||||
render(Render::Line(&input))?;
|
render(Render::Line(&input))?;
|
||||||
}
|
}
|
||||||
event::KeyCode::Backspace => {
|
event::KeyCode::Backspace if !input.is_empty() => {
|
||||||
if !input.is_empty() {
|
|
||||||
input.pop();
|
input.pop();
|
||||||
render(Render::Line(&input))?;
|
render(Render::Line(&input))?;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -433,12 +431,10 @@ fn confirm_inner(
|
|||||||
input.push(c);
|
input.push(c);
|
||||||
render(Render::Line(&input))?;
|
render(Render::Line(&input))?;
|
||||||
}
|
}
|
||||||
event::KeyCode::Backspace => {
|
event::KeyCode::Backspace if !input.is_empty() => {
|
||||||
if !input.is_empty() {
|
|
||||||
input.pop();
|
input.pop();
|
||||||
render(Render::Line(&input))?;
|
render(Render::Line(&input))?;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user