clippy: convert single match to if let

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2021-01-19 12:09:33 +01:00
parent ea368a06cd
commit b92cad0938
7 changed files with 66 additions and 88 deletions

View File

@ -207,11 +207,8 @@ impl Job {
/// Start the job and update the statefile accordingly
/// Fails if the job was already started
pub fn start(&mut self, upid: &str) -> Result<(), Error> {
match self.state {
JobState::Started { .. } => {
bail!("cannot start job that is started!");
}
_ => {}
if let JobState::Started { .. } = self.state {
bail!("cannot start job that is started!");
}
self.state = JobState::Started {