Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
🚑 Crawler: fix the missing serde_as
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Sep 7, 2022
1 parent 5c3d702 commit 18abd5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/database/mongodb/models/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub struct Account {
pub prio: bool,

#[serde(rename = "due", default)]
#[serde_as(as = "bson::DateTime")]
pub next_check_at: DateTime,
}

Expand Down
4 changes: 2 additions & 2 deletions src/database/mongodb/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ pub trait TypedDocument: 'static + Sized + Send + Sync + DeserializeOwned + Unpi
Self::collection(in_)
.find(filter, options)
.await
.with_context(|| format!("failed to search in `{}`", Self::NAME))?
.map_err(|error| anyhow!("failed to search in `{}`: {}", Self::NAME, error))?
.try_collect()
.await
.with_context(|| format!("failed to collect a vector from `{}`", Self::NAME))
.map_err(|error| anyhow!("failed to collect from `{}`: {}", Self::NAME, error))
}
}

Expand Down

0 comments on commit 18abd5d

Please sign in to comment.