forked from Rust-related/RustPython
Fix clippy warnings
This commit is contained in:
@@ -562,7 +562,7 @@ where
|
||||
match tree {
|
||||
UseTree::Name(name) => result.push(f(&name.ident, false)?),
|
||||
UseTree::Rename(rename) => result.push(f(&rename.rename, false)?),
|
||||
UseTree::Path(path) => iter_use_tree_idents(&*path.tree, result, f)?,
|
||||
UseTree::Path(path) => iter_use_tree_idents(&path.tree, result, f)?,
|
||||
UseTree::Group(syn::UseGroup { items, .. }) => {
|
||||
for subtree in items {
|
||||
iter_use_tree_idents(subtree, result, f)?;
|
||||
|
||||
@@ -304,7 +304,7 @@ mod winreg {
|
||||
let nul_pos = wide_slice
|
||||
.iter()
|
||||
.position(|w| *w == 0)
|
||||
.unwrap_or_else(|| wide_slice.len());
|
||||
.unwrap_or(wide_slice.len());
|
||||
let s = String::from_utf16_lossy(&wide_slice[..nul_pos]);
|
||||
Ok(vm.ctx.new_str(s).into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user