refactor: remove extraneous Some
This commit is contained in:
parent
88bfa7796b
commit
fd7ab070f1
|
@ -126,9 +126,9 @@ pub async fn get_stats_seven_days(state: &State) -> Result<Statistics> {
|
||||||
async fn get_stats_internal(state: &State, docs: impl IntoIterator<Item = Document>) -> Result<Statistics> {
|
async fn get_stats_internal(state: &State, docs: impl IntoIterator<Item = Document>) -> Result<Statistics> {
|
||||||
let mut cursor = state
|
let mut cursor = state
|
||||||
.collection()
|
.collection()
|
||||||
.aggregate(docs, Some(AggregateOptions::builder()
|
.aggregate(docs, AggregateOptions::builder()
|
||||||
.allow_disk_use(true)
|
.allow_disk_use(true)
|
||||||
.build()))
|
.build())
|
||||||
.await?;
|
.await?;
|
||||||
let doc = cursor.try_next().await?;
|
let doc = cursor.try_next().await?;
|
||||||
let doc = doc.ok_or_else(|| anyhow::anyhow!("missing document"))?;
|
let doc = doc.ok_or_else(|| anyhow::anyhow!("missing document"))?;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user