Fix clippy issues

This commit is contained in:
Francis Murillo 2023-01-19 19:38:20 +08:00
parent 6993924f32
commit 798aa4ee92
No known key found for this signature in database
GPG Key ID: 2D816FFCF0F44A70
2 changed files with 9 additions and 10 deletions

View File

@ -113,7 +113,7 @@ impl V3Reader {
Ok(self.index_uuid.iter().map(|index| -> Result<_> { Ok(self.index_uuid.iter().map(|index| -> Result<_> {
V3IndexReader::new( V3IndexReader::new(
&self.dump.path().join("indexes").join(index.uuid.to_string()), &self.dump.path().join("indexes").join(index.uuid.to_string()),
&index, index,
BufReader::new( BufReader::new(
File::open(self.dump.path().join("updates").join("data.jsonl")).unwrap(), File::open(self.dump.path().join("updates").join("data.jsonl")).unwrap(),
), ),
@ -150,7 +150,6 @@ impl V3Reader {
} }
} }
#[derive(Debug)]
pub struct V3IndexReader { pub struct V3IndexReader {
metadata: IndexMetadata, metadata: IndexMetadata,
settings: Settings<Checked>, settings: Settings<Checked>,
@ -169,7 +168,7 @@ impl V3IndexReader {
for line in tasks.lines() { for line in tasks.lines() {
let task: Task = serde_json::from_str(&line?)?; let task: Task = serde_json::from_str(&line?)?;
if task.uuid != index_uuid.uuid || !task.is_finished() { if !(task.uuid == index_uuid.uuid && task.is_finished()) {
continue; continue;
} }

View File

@ -77,11 +77,11 @@ impl UpdateStatus {
pub fn enqueued_at(&self) -> Option<OffsetDateTime> { pub fn enqueued_at(&self) -> Option<OffsetDateTime> {
match self { match self {
UpdateStatus::Processing(u) => Some(u.from.enqueued_at.clone()), UpdateStatus::Processing(u) => Some(u.from.enqueued_at),
UpdateStatus::Enqueued(u) => Some(u.enqueued_at.clone()), UpdateStatus::Enqueued(u) => Some(u.enqueued_at),
UpdateStatus::Processed(u) => Some(u.from.from.enqueued_at.clone()), UpdateStatus::Processed(u) => Some(u.from.from.enqueued_at),
UpdateStatus::Aborted(u) => Some(u.from.enqueued_at.clone()), UpdateStatus::Aborted(u) => Some(u.from.enqueued_at),
UpdateStatus::Failed(u) => Some(u.from.from.enqueued_at.clone()), UpdateStatus::Failed(u) => Some(u.from.from.enqueued_at),
} }
} }
@ -89,9 +89,9 @@ impl UpdateStatus {
match self { match self {
UpdateStatus::Processing(_) => None, UpdateStatus::Processing(_) => None,
UpdateStatus::Enqueued(_) => None, UpdateStatus::Enqueued(_) => None,
UpdateStatus::Processed(u) => Some(u.processed_at.clone()), UpdateStatus::Processed(u) => Some(u.processed_at),
UpdateStatus::Aborted(_) => None, UpdateStatus::Aborted(_) => None,
UpdateStatus::Failed(u) => Some(u.failed_at.clone()), UpdateStatus::Failed(u) => Some(u.failed_at),
} }
} }
} }