diff --git a/sqlx-core/src/any/options.rs b/sqlx-core/src/any/options.rs index 08361eaeeb..08c431a84c 100644 --- a/sqlx-core/src/any/options.rs +++ b/sqlx-core/src/any/options.rs @@ -50,12 +50,12 @@ impl ConnectOptions for AnyConnectOptions { Box::pin(AnyConnection::establish(self)) } - fn log_statements(&mut self, level: LevelFilter) -> &mut Self { + fn log_statements(mut self, level: LevelFilter) -> Self { self.log_settings.statements_level = level; self } - fn log_slow_statements(&mut self, level: LevelFilter, duration: Duration) -> &mut Self { + fn log_slow_statements(mut self, level: LevelFilter, duration: Duration) -> Self { self.log_settings.slow_statements_level = level; self.log_settings.slow_statements_duration = duration; self diff --git a/sqlx-core/src/connection.rs b/sqlx-core/src/connection.rs index 829e4bb599..c73b23f47e 100644 --- a/sqlx-core/src/connection.rs +++ b/sqlx-core/src/connection.rs @@ -170,14 +170,14 @@ pub trait ConnectOptions: 'static + Send + Sync + FromStr + Debug + Self::Connection: Sized; /// Log executed statements with the specified `level` - fn log_statements(&mut self, level: LevelFilter) -> &mut Self; + fn log_statements(self, level: LevelFilter) -> Self; /// Log executed statements with a duration above the specified `duration` /// at the specified `level`. - fn log_slow_statements(&mut self, level: LevelFilter, duration: Duration) -> &mut Self; + fn log_slow_statements(self, level: LevelFilter, duration: Duration) -> Self; /// Entirely disables statement logging (both slow and regular). - fn disable_statement_logging(&mut self) -> &mut Self { + fn disable_statement_logging(self) -> Self { self.log_statements(LevelFilter::Off) .log_slow_statements(LevelFilter::Off, Duration::default()) } diff --git a/sqlx-mysql/src/options/connect.rs b/sqlx-mysql/src/options/connect.rs index 0e07e8331c..e6a8600272 100644 --- a/sqlx-mysql/src/options/connect.rs +++ b/sqlx-mysql/src/options/connect.rs @@ -67,12 +67,12 @@ impl ConnectOptions for MySqlConnectOptions { }) } - fn log_statements(&mut self, level: LevelFilter) -> &mut Self { + fn log_statements(mut self, level: LevelFilter) -> Self { self.log_settings.log_statements(level); self } - fn log_slow_statements(&mut self, level: LevelFilter, duration: Duration) -> &mut Self { + fn log_slow_statements(mut self, level: LevelFilter, duration: Duration) -> Self { self.log_settings.log_slow_statements(level, duration); self } diff --git a/sqlx-postgres/src/options/connect.rs b/sqlx-postgres/src/options/connect.rs index 295768311b..f61909a9e8 100644 --- a/sqlx-postgres/src/options/connect.rs +++ b/sqlx-postgres/src/options/connect.rs @@ -20,12 +20,12 @@ impl ConnectOptions for PgConnectOptions { Box::pin(PgConnection::establish(self)) } - fn log_statements(&mut self, level: LevelFilter) -> &mut Self { + fn log_statements(mut self, level: LevelFilter) -> Self { self.log_settings.log_statements(level); self } - fn log_slow_statements(&mut self, level: LevelFilter, duration: Duration) -> &mut Self { + fn log_slow_statements(mut self, level: LevelFilter, duration: Duration) -> Self { self.log_settings.log_slow_statements(level, duration); self } diff --git a/sqlx-sqlite/src/options/connect.rs b/sqlx-sqlite/src/options/connect.rs index b717a99032..3b4b531370 100644 --- a/sqlx-sqlite/src/options/connect.rs +++ b/sqlx-sqlite/src/options/connect.rs @@ -37,12 +37,12 @@ impl ConnectOptions for SqliteConnectOptions { }) } - fn log_statements(&mut self, level: LevelFilter) -> &mut Self { + fn log_statements(mut self, level: LevelFilter) -> Self { self.log_settings.log_statements(level); self } - fn log_slow_statements(&mut self, level: LevelFilter, duration: Duration) -> &mut Self { + fn log_slow_statements(mut self, level: LevelFilter, duration: Duration) -> Self { self.log_settings.log_slow_statements(level, duration); self }