mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-30 12:07:46 +00:00
refac: clippy warns
This commit is contained in:
parent
2bb91e309c
commit
a1b3745de9
3 changed files with 6 additions and 6 deletions
|
@ -76,8 +76,8 @@ impl Children {
|
|||
}
|
||||
}
|
||||
|
||||
if pos.is_some() {
|
||||
pos.as_mut().unwrap().update(&node.text().to_string());
|
||||
if let Some(ref mut pos) = pos {
|
||||
pos.update(&node.text().to_string());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,8 +105,8 @@ impl Children {
|
|||
}
|
||||
}
|
||||
|
||||
if pos.is_some() {
|
||||
pos.as_mut().unwrap().update(token.text());
|
||||
if let Some(ref mut pos) = pos {
|
||||
pos.update(token.text());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ pub(crate) fn rule(
|
|||
}
|
||||
}
|
||||
|
||||
for (index, child) in children.into_iter().enumerate() {
|
||||
for (index, child) in children.enumerate() {
|
||||
let not_last_child = index + 1 < children_count;
|
||||
|
||||
if vertical {
|
||||
|
|
|
@ -45,7 +45,7 @@ fn to_full_path(entry: walkdir::DirEntry) -> String {
|
|||
}
|
||||
|
||||
fn len_of(path: &str) -> u64 {
|
||||
match std::fs::metadata(&path) {
|
||||
match std::fs::metadata(path) {
|
||||
Ok(meta) => meta.len(),
|
||||
Err(err) => {
|
||||
eprintln!("Could not get the size of file at: {path}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue