mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:35 +00:00
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:
parent
9cf4621071
commit
0bb8b14ae1
2 changed files with 9 additions and 10 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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())
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue