You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor: Improve sqlx-core and sqlx-macros code quality
This commit includes several refactorings and improvements across sqlx-core and sqlx-macros. Key changes include:
- **sqlx-core:**
- Added `#[cfg(feature = "sqlite")]` guards to `DebugFn` and its implementations to conditionally compile them only when the SQLite feature is enabled.
- Removed unused `write` method from `buf_stream.rs` and added `#[allow(dead_code)]` to other unused methods.
- Derived `Default` for `MySqlSslMode` and removed manual implementation.
- Added `#[allow(dead_code)]` to `warnings` field in `EofPacket`.
- Improved `f32` decoding for MySQL to clamp values to the `f32` range before casting.
- Corrected `is_null` implementation in `mysql/value.rs` to use `self.value` directly.
- Added `#[allow(dead_code)]` to `local_addr` in `net/socket.rs`.
- Fixed potential issues with TLS stream upgrading and downgrading in `net/tls/mod.rs`, including adding `#[allow(dead_code)]` to `downgrade`.
- Removed generic `DB: Database` from `deadline_as_timeout` in `pool/inner.rs` and `pool/mod.rs` as it was unused.
- **sqlx-macros:**
- Wrapped `Type` in `Box` for `RecordType::Given` and `ColumnTypeOverride::Exact` to avoid potential stack overflows with deeply nested types.
- Corrected the `migrations_path` resolution in `test_attr.rs` to use the span of the input signature.
- Added `#[allow(dead_code)]` to `Args` and `MigrationsOpt` structs in `test_attr.rs`.
- Fixed a minor formatting issue in the documentation for `query!()`.
Co-authored-by: contact <[email protected]>
0 commit comments