mirror of https://github.com/mtshiba/pylyzer
fix: eliminate `unwrap`s
This commit is contained in:
parent
9a9215ef58
commit
a0d713b2d2
|
|
@ -3163,7 +3163,7 @@ impl ASTConverter {
|
|||
if path.ends_with("__init__.py") {
|
||||
path.pop();
|
||||
}
|
||||
let mod_name = path.file_name().unwrap();
|
||||
let mod_name = path.file_name().unwrap_or_default();
|
||||
if name.name.as_str() == mod_name.to_string_lossy().trim_end_matches(".py") {
|
||||
let sym = format!("{module}/{}", name.name);
|
||||
let mod_name = Expr::Literal(Literal::new(quoted_symbol(
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ impl SimplePythonParser {
|
|||
// let mut locator = LinearLocator::new(&py_code);
|
||||
let err = locator.locate_error::<_, ParseErrorType>(err);
|
||||
let msg = err.to_string();
|
||||
let loc = err.location.unwrap();
|
||||
let loc = err.location.unwrap_or_default();
|
||||
let core = ErrorCore::new(
|
||||
vec![],
|
||||
msg,
|
||||
|
|
|
|||
Loading…
Reference in New Issue