Use Iterator::all in two places

This commit is contained in:
bjorn3
2025-04-01 21:53:28 +02:00
parent 22f759aa4f
commit 7e3915deb6
2 changed files with 2 additions and 12 deletions
+1 -6
View File
@@ -169,12 +169,7 @@ unsafe impl<T> BlockTrait for BlockList<T> {
impl<T> BlockList<T> {
pub fn is_empty(&self) -> bool {
for ptr in self.ptrs.iter() {
if !ptr.is_null() {
return false;
}
}
true
self.ptrs.iter().all(|ptr| ptr.is_null())
}
}
+1 -6
View File
@@ -68,12 +68,7 @@ unsafe impl BlockTrait for DirList {
impl DirList {
pub fn is_empty(&self) -> bool {
for entry in self.entries.iter() {
if !entry.node_ptr().is_null() {
return false;
}
}
true
self.entries.iter().all(|entry| entry.node_ptr().is_null())
}
}