chore: Ran cargo clippy & cargo fmt

This commit is contained in:
quexeky
2025-01-20 08:55:19 +11:00
parent c2d8966c1a
commit fdccb10650
26 changed files with 144 additions and 126 deletions
@@ -32,7 +32,7 @@ impl Queue {
pub fn pop_front(&self) -> Option<DownloadableMetadata> {
self.edit().pop_front()
}
pub fn empty(&self) -> bool {
pub fn is_empty(&self) -> bool {
self.inner.lock().unwrap().len() == 0
}
pub fn exists(&self, meta: DownloadableMetadata) -> bool {
@@ -52,10 +52,7 @@ impl Queue {
}
pub fn pop_front_if_equal(&self, meta: &DownloadableMetadata) -> Option<DownloadableMetadata> {
let mut queue = self.edit();
let front = match queue.front() {
Some(front) => front,
None => return None,
};
let front = queue.front()?;
if front == meta {
return queue.pop_front();
}