Skip to content

Commit

Permalink
Implement Default for QueryBuilder (#2605)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xydez authored Jul 14, 2023
1 parent 3662bda commit f7ce8fd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sqlx-core/src/query_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ where
arguments: Option<<DB as HasArguments<'args>>::Arguments>,
}

impl<'args, DB: Database> Default for QueryBuilder<'args, DB> {
fn default() -> Self {
QueryBuilder {
init_len: 0,
query: String::default(),
arguments: Some(Default::default()),
}
}
}

impl<'args, DB: Database> QueryBuilder<'args, DB>
where
DB: Database,
Expand Down

0 comments on commit f7ce8fd

Please sign in to comment.