fix: QueryResult should be Clone + Default

This commit is contained in:
Ryan Leckey
2021-03-07 10:35:54 -08:00
parent 5a5ce82946
commit 3bd6a5a356
5 changed files with 18 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ use sqlx_core::QueryResult;
/// Returned from [`execute()`][sqlx_core::Executor::execute].
///
#[allow(clippy::module_name_repetitions)]
#[derive(Clone)]
#[derive(Clone, Default)]
pub struct PgQueryResult {
command: ByteString,
rows_affected: u64,
@@ -38,6 +38,7 @@ impl PgQueryResult {
///
/// This is usually a single word that identifies which SQL command
/// was completed (e.g.,`INSERT`, `UPDATE`, or `MOVE`).
///
#[must_use]
pub fn command(&self) -> &str {
&self.command