diff --git a/dump/src/reader/v3/mod.rs b/dump/src/reader/v3/mod.rs index 59be1924b..560a901cd 100644 --- a/dump/src/reader/v3/mod.rs +++ b/dump/src/reader/v3/mod.rs @@ -113,7 +113,7 @@ impl V3Reader { Ok(self.index_uuid.iter().map(|index| -> Result<_> { V3IndexReader::new( &self.dump.path().join("indexes").join(index.uuid.to_string()), - &index, + index, BufReader::new( File::open(self.dump.path().join("updates").join("data.jsonl")).unwrap(), ), @@ -150,7 +150,6 @@ impl V3Reader { } } -#[derive(Debug)] pub struct V3IndexReader { metadata: IndexMetadata, settings: Settings, @@ -169,7 +168,7 @@ impl V3IndexReader { for line in tasks.lines() { 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; } diff --git a/dump/src/reader/v3/updates.rs b/dump/src/reader/v3/updates.rs index 89d0b86bb..0d8325d47 100644 --- a/dump/src/reader/v3/updates.rs +++ b/dump/src/reader/v3/updates.rs @@ -77,11 +77,11 @@ impl UpdateStatus { pub fn enqueued_at(&self) -> Option { match self { - UpdateStatus::Processing(u) => Some(u.from.enqueued_at.clone()), - UpdateStatus::Enqueued(u) => Some(u.enqueued_at.clone()), - UpdateStatus::Processed(u) => Some(u.from.from.enqueued_at.clone()), - UpdateStatus::Aborted(u) => Some(u.from.enqueued_at.clone()), - UpdateStatus::Failed(u) => Some(u.from.from.enqueued_at.clone()), + UpdateStatus::Processing(u) => Some(u.from.enqueued_at), + UpdateStatus::Enqueued(u) => Some(u.enqueued_at), + UpdateStatus::Processed(u) => Some(u.from.from.enqueued_at), + UpdateStatus::Aborted(u) => Some(u.from.enqueued_at), + UpdateStatus::Failed(u) => Some(u.from.from.enqueued_at), } } @@ -89,9 +89,9 @@ impl UpdateStatus { match self { UpdateStatus::Processing(_) => None, UpdateStatus::Enqueued(_) => None, - UpdateStatus::Processed(u) => Some(u.processed_at.clone()), + UpdateStatus::Processed(u) => Some(u.processed_at), UpdateStatus::Aborted(_) => None, - UpdateStatus::Failed(u) => Some(u.failed_at.clone()), + UpdateStatus::Failed(u) => Some(u.failed_at), } } }