Fix clippy warnings

This commit is contained in:
Jeong Yunwon
2022-08-16 07:28:55 +09:00
parent 50aa730aad
commit f5ed346716
2 changed files with 2 additions and 2 deletions

View File

@@ -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)?;

View File

@@ -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())
}