Address clippy warnings and add to gh actions#32
Conversation
This commit makes several improvements including: - Using `try_into` for safer type conversions from `i32` to `usize` and `c_int`. - Replacing `&*` with direct dereferencing for string slices. - Adding a clippy workflow to catch potential issues. - Minor refactoring in various modules for clarity and consistency. Co-authored-by: contact <contact@ophir.dev>
|
Cursor Agent can help with this pull request. Just |
Co-authored-by: contact <contact@ophir.dev>
Co-authored-by: contact <contact@ophir.dev>
…loops, conversions)
…td: drop unused imports; pg options: adjust AsRef where needed
Co-authored-by: contact <contact@ophir.dev>
Co-authored-by: contact <contact@ophir.dev>
Co-authored-by: contact <contact@ophir.dev>
Co-authored-by: contact <contact@ophir.dev>
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 <contact@ophir.dev>
|
|
I implemented a new
Learn more about Cursor Agents |
Co-authored-by: contact <contact@ophir.dev>
Co-authored-by: contact <contact@ophir.dev>
Co-authored-by: contact <contact@ophir.dev>
error[E0433]: failed to resolve: use of unresolved module or unlinked crate For more information about this error, try |
|
I performed a minor refactoring to improve code clarity and consistency within the PostgreSQL copy-in functionality. This change simplifies a constructor call in the
Learn more about Cursor Agents |
Co-authored-by: contact <contact@ophir.dev>
Add Clippy CI workflow with a feature matrix and fix numerous Clippy warnings across the workspace.
The Clippy workflow runs for multiple feature combinations per package to ensure no warnings are introduced under various configurations, specifically addressing concerns about feature-gated code and unused imports.