Fix miscellaneous Clippy lints
This commit is contained in:
@@ -275,7 +275,7 @@ impl ast::PathSegment {
|
||||
|
||||
impl ast::UseTree {
|
||||
pub fn remove(&self) {
|
||||
for &dir in [Direction::Next, Direction::Prev].iter() {
|
||||
for dir in [Direction::Next, Direction::Prev] {
|
||||
if let Some(next_use_tree) = neighbor(self, dir) {
|
||||
let separators = self
|
||||
.syntax()
|
||||
|
||||
@@ -276,9 +276,9 @@ impl ast::Path {
|
||||
|
||||
impl ast::Use {
|
||||
pub fn is_simple_glob(&self) -> bool {
|
||||
self.use_tree()
|
||||
.map(|use_tree| use_tree.use_tree_list().is_none() && use_tree.star_token().is_some())
|
||||
.unwrap_or(false)
|
||||
self.use_tree().map_or(false, |use_tree| {
|
||||
use_tree.use_tree_list().is_none() && use_tree.star_token().is_some()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -688,7 +688,7 @@ impl Radix {
|
||||
pub const ALL: &'static [Radix] =
|
||||
&[Radix::Binary, Radix::Octal, Radix::Decimal, Radix::Hexadecimal];
|
||||
|
||||
const fn prefix_len(&self) -> usize {
|
||||
const fn prefix_len(self) -> usize {
|
||||
match self {
|
||||
Self::Decimal => 0,
|
||||
_ => 2,
|
||||
|
||||
Reference in New Issue
Block a user