Fix clippy::single_match_else (pedantic)

https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2022-11-21 19:18:33 -08:00 committed by Charlie Marsh
parent 9cf4621071
commit 0bb8b14ae1
2 changed files with 9 additions and 10 deletions

View file

@ -101,8 +101,8 @@ pub fn iter_python_files<'a>(
true true
} }
} }
Err(_) => { Err(e) => {
debug!("Ignored path due to error in parsing: {:?}", path); debug!("Ignored path due to error in parsing: {:?}: {}", path, e);
true true
} }
} }

View file

@ -81,16 +81,15 @@ pub fn find_project_root(sources: &[PathBuf]) -> Option<PathBuf> {
} }
pub fn load_options(pyproject: Option<&PathBuf>) -> Result<Options> { pub fn load_options(pyproject: Option<&PathBuf>) -> Result<Options> {
match pyproject { if let Some(pyproject) = pyproject {
Some(pyproject) => Ok(parse_pyproject_toml(pyproject)? Ok(parse_pyproject_toml(pyproject)?
.tool .tool
.and_then(|tool| tool.ruff) .and_then(|tool| tool.ruff)
.unwrap_or_default()), .unwrap_or_default())
None => { } else {
debug!("No pyproject.toml found."); debug!("No pyproject.toml found.");
debug!("Falling back to default configuration..."); debug!("Falling back to default configuration...");
Ok(Options::default()) Ok(Options::default())
}
} }
} }