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
AI code cleanup: Address clippy warnings and add to gh actions (#31)
* Add clippy checks and suppress doctest warning
Co-authored-by: contact <[email protected]>
* Refactor: Add 'q lifetime bound to Execute trait
This change adds the 'q lifetime bound to the Execute trait in various executor implementations. This ensures that the query parameters live long enough for the query to be executed, preventing potential lifetime issues.
Co-authored-by: contact <[email protected]>
* Refactor: Improve sqlx code quality and fix minor issues
Co-authored-by: contact <[email protected]>
* fix: resolve clippy warnings in pool/inner.rs
- Fix non-binding let on future by spawning close() future
- Replace map_or(false, ...) with is_some_and(...)
- Remove needless borrow in Arc::clone()
* fix: resolve additional clippy warnings
- Fix let_underscore_future by explicitly dropping the future
- Remove unused type parameter DB from deadline_as_timeout function
* fix: resolve clippy warnings in query, io, and tls modules
- Fix reference to reference pattern in query.rs
- Remove redundant closure using and_then directly
- Remove needless borrows in io/buf.rs and logger.rs
- Replace iter().cloned().collect() with to_vec() for better performance
- Use std::io::Error::other() instead of Error::new(ErrorKind::Other)
* fix: resolve more clippy warnings
- Remove reference patterns in query.rs match statements
- Fix unneeded return statements in net/tls/mod.rs
- Remove explicit deref in postgres/column.rs
- Revert redundant closure fix that caused compilation error
* fix: resolve auto-deref and other clippy warnings
- Remove explicit derefs that would be done by auto-deref
- Fix needless borrows in various modules
- Replace is_digit(10) with is_ascii_digit()
- Fix doc list indentation in postgres/copy.rs
* fix: resolve redundant closures and more auto-deref warnings
- Remove redundant closures in lquery and ltree types
- Fix auto-deref issues in postgres options parser
- Fix auto-deref issues in postgres type_info
* fix: apply automatic clippy fixes and resolve type conversion issues
- Fix Cow<str> to Path conversions by using value.as_ref()
- Remove unnecessary mut from variable declaration
- Apply various automatic clippy fixes for redundant code
* fix: resolve remaining simple clippy warnings
- Remove unused mut from variable declaration
- Remove unused lifetime parameter
- Remove legacy numeric constant import
- Simplify boolean expression using De Morgan's law
* fix: resolve large enum variant and naming warnings
- Box the TlsStream variant to reduce enum size
- Rename from_iter methods to avoid confusion with std trait
- Update all pattern matches to handle boxed variant
* Refactor: Improve TLS stream handling and add test script
Co-authored-by: contact <[email protected]>
* Checkpoint before follow-up message
Co-authored-by: contact <[email protected]>
* fix: clippy warnings for mssql, any, postgres, and sqlite modules
- Remove empty line after doc comment in tls_prelogin_stream_wrapper.rs
- Fix needless_borrow in ustr.rs, logger.rs, any/statement.rs
- Fix unneeded_return in logger.rs
- Add allow for large_enum_variant in AnyConnectionKind
- Fix never_loop in postgres time_tz.rs by simplifying DateTime parsing
- Fix module_inception by renaming time module to time_impl
- Fix manual_div_ceil using div_ceil method
- Fix deref which would be done by auto-deref in sqlite/column.rs
- Fix wrong_self_convention by making as_int take &self
- Fix useless_conversion and needless_borrow in sqlite/connection/execute.rs
* fix: more clippy warnings in sqlite and logger modules
- Fix match_like_matches_macro by using is_some() in logger.rs
- Fix needless_borrow warnings in sqlite/connection/execute.rs
- Fix ptr_arg by using slice instead of Vec reference
- Fix clone_on_copy by dereferencing instead of cloning
- Fix needless_return by removing redundant return keyword
- Fix explicit_counter_loop by using enumerate()
* fix: more clippy warnings in sqlite modules
- Fix unused_mut in sqlite/connection/execute.rs
- Fix manual_inspect by using inspect instead of map
- Fix derivable_impls by deriving Default for sqlite option enums
- Fix map_clone by using copied() method
- Fix legacy_numeric_constants by using i32::MAX instead of importing
* fix: clippy warnings for mysql and final sqlite modules
- Fix unnecessary_cast in sqlite/statement/virtual.rs
- Add is_empty() method to MySqlArguments to fix len_without_is_empty
- Fix explicit_auto_deref in mysql/column.rs and mysql/options/parse.rs
- Fix needless_borrows_for_generic_args in mysql/connection/auth.rs
- Fix borrow_deref_ref in mysql/connection/auth.rs
- Fix needless_borrow in mysql/connection/auth.rs and executor.rs
- Remove unused lifetime in mysql/connection/executor.rs
- Fix get_first by using first() instead of get(0)
* fix: more clippy warnings in mysql modules
- Fix explicit_auto_deref in mysql/options/parse.rs and mysql/transaction.rs
- Replace manual Default impl with derive for MySqlSslMode
- Add allow for enum_variant_names in AuthPlugin (breaking change to fix)
- Fix get_first by using first() instead of get(0)
- Fix unnecessary_cast by removing redundant casts
- Fix map_clone by using copied() method in row and statement modules
* fix: clippy warnings in mysql types and migrate modules
- Fix let_and_return in mysql/types/float.rs
- Fix needless_borrows_for_generic_args in chrono and time modules
- Fix len_zero by using is_empty()
- Fix unnecessary_cast by removing redundant type casts
- Fix unwrap_or_default usage
- Fix needless_borrow in json module
- Fix needless_option_as_deref in value module
- Fix get_first by using first() instead of get(0)
- Fix needless_return in migrate module
* fix: clippy warnings in mysql testing and mssql modules
- Fix op_ref by using direct comparison in mysql/migrate.rs
- Fix needless_borrows_for_generic_args in mysql/testing/mod.rs
- Fix drop_non_drop by using let binding instead of drop
- Fix single_char_add_str by using push() with char literal
- Fix explicit_auto_deref in mssql/column.rs and establish.rs
- Fix io_other_error by using std::io::Error::other()
- Fix unnecessary_map_or by using is_some_and()
- Fix unit_arg by using Default::default()
- Add allow for let_unit_value due to platform differences
* fix: more clippy warnings in mssql modules
- Fix unit_arg by using () instead of Default::default()
- Fix redundant_closure by using function reference directly
- Fix while_let_on_iterator by using for loop
- Fix explicit_auto_deref in mssql/options/parse.rs
- Add allow for result_large_err in requested_packet_size
- Fix needless_range_loop by iterating over slice directly
- Add allow for ptr_arg where Vec-specific methods are used
* fix: final clippy warnings in mssql modules
- Fix unused_mut in mssql/io/buf_mut.rs
- Fix useless_conversion by removing redundant .into()
- Fix manual_div_ceil by using div_ceil method
* fix: platform-specific return type for async-std in tls_prelogin_stream_wrapper
- Return 0 for async-std and () for tokio in poll_read
- Fixes compilation with runtime-async-std-rustls feature
* Refactor: Remove unused blank lines and reorder imports
Co-authored-by: contact <[email protected]>
* fix: clippy warnings in tests and macros
- Fix deprecated chrono DateTime::from_utc usage
- Add workspace lint config to allow postgres_14 cfg
- Fix dead code warnings in sqlx-macros query data
- Fix needless_borrows_for_generic_args in sqlx-macros
- Fix useless_conversion by removing redundant .into()
- Fix useless_vec by using array instead of vec! in test
* cargo fmt
* fix: update type annotations for DateTime in MySQL tests
- Change DateTime::from_naive_utc_and_offset to DateTime::<Utc>::from_naive_utc_and_offset in chrono tests
* refactor: remove unused custom domain type and update imports in tests
- Removed the unused RangeInclusive struct from derives.rs
- Added #[allow(unused_imports)] to macros.rs and types.rs to suppress warnings
* fix: correct error handling in native-tls downgrade message
* refactor: streamline clippy checks in CI workflow
- Removed clippy job and integrated checks into existing jobs for core, root, and all targets.
- Added clippy checks for sqlite, postgres, mysql, mariadb, and mssql with specific features.
- Enhanced CI workflow efficiency by consolidating clippy steps.
* fix: update lint configurations and suppress unused import warnings in tests
- Added 'cfg(postgres_9_6)' to the lint configuration in Cargo.toml.
- Suppressed unused import warnings in various test files for better clarity and maintainability.
- Adjusted assertions in MySQL tests for boolean values to use assert! macro.
* fmt
* chore: add unused import suppressions in test files
- Included additional imports for Executor and Row in pool.rs and types.rs respectively.
- Suppressed unused import warnings to enhance code clarity.
* refactor: remove test_all_features.sh script and suppress unused import warnings
- Deleted the test_all_features.sh script to streamline the testing process.
- Added unused import suppressions in test_attr.rs and mssql.rs for improved code clarity.
* refactor: rename from_label_iter to from_iter for consistency
- Renamed the method from_label_iter to from_iter in PgLTree to align with naming conventions and improve clarity.
---------
Co-authored-by: Cursor Agent <[email protected]>
0 commit comments