Skip to content

Commit

Permalink
chore(fix): don´t require default for results
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelFreeze committed Oct 20, 2023
1 parent a65d4f6 commit e395982
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/d1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Database {
/// Returns the results in the same order as the provided statements.
pub async fn batch<T>(&self, statements: Vec<PreparedStatement>) -> Result<Vec<D1Result<T>>>
where
T: for<'a> Deserialize<'a> + Default, {
T: for<'a> Deserialize<'a>, {
let future = {
let statements = statements
.into_iter()
Expand Down Expand Up @@ -203,7 +203,7 @@ impl PreparedStatement {
/// Executes a query against the database and returns all rows.
pub async fn all<T>(&self) -> Result<D1Result<T>>
where
T: for<'a> Deserialize<'a> + Default, {
T: for<'a> Deserialize<'a>, {
let future = SendWrapper::new(JsFuture::from(self.0.all()));
wrap_send(async move {
let value = future.await.map_err(map_promise_err)?;
Expand Down
2 changes: 1 addition & 1 deletion lib/d1/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl D1ResultMetadata {
#[derive(Deserialize)]
/// The result of a D1 database execution.
pub struct D1Result<T = ()> {
#[serde(default)]
#[serde(default = "Vec::new")]
results: Vec<T>,
success: bool,
meta: Option<D1ResultMetadata>,
Expand Down

0 comments on commit e395982

Please sign in to comment.