No need to surround statements with an Arc

This commit is contained in:
Tobie Morgan Hitchcock 2022-05-17 00:12:58 +01:00
parent 82cbfad38d
commit 073285574a
2 changed files with 3 additions and 6 deletions

View file

@ -31,7 +31,6 @@ use rand::rngs::OsRng;
use rand::Rng;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::sync::Arc;
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Store)]
pub enum DefineStatement {
@ -608,7 +607,7 @@ impl DefineTableStatement {
what: Values(vec![Value::Table(v.clone())]),
..UpdateStatement::default()
};
Arc::new(stm).compute(ctx, opt, txn, doc).await?;
stm.compute(ctx, opt, txn, doc).await?;
}
}
// Ok all good
@ -981,7 +980,7 @@ impl DefineIndexStatement {
what: Values(vec![Value::Table(self.what.clone().into())]),
..UpdateStatement::default()
};
Arc::new(stm).compute(ctx, opt, txn, doc).await?;
stm.compute(ctx, opt, txn, doc).await?;
// Ok all good
Ok(Value::None)
}

View file

@ -9,7 +9,6 @@ use crate::sql::statements::select::SelectStatement;
use crate::sql::value::{Value, Values};
use async_recursion::async_recursion;
use futures::future::try_join_all;
use std::sync::Arc;
impl Value {
#[cfg_attr(feature = "parallel", async_recursion)]
@ -78,8 +77,7 @@ impl Value {
what: Values(vec![Value::Thing(v.clone())]),
..SelectStatement::default()
};
Arc::new(stm)
.compute(ctx, opt, txn, None)
stm.compute(ctx, opt, txn, None)
.await?
.first()
.get(ctx, opt, txn, path)