fix clippy on main#37042
Merged
Merged
Conversation
Route mz-deploy's database access through the mz_postgres_util Sql wrappers instead of calling tokio_postgres methods directly, resolving the clippy::disallowed_methods warnings that clippy.toml enforces repo-wide. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
cargo clippy -p mz-deploysurfaced 7clippy::disallowed_methodswarnings. The crate was callingtokio_postgresquery/execute methods directly, whichclippy.tomldisallows repo-wide in favor of themz_postgres_utilSqlwrappers — these force SQL through the validatedSqltype rather than raw strings.Changes
src/mz-deploy/Cargo.toml— addmz-postgres-utilas a path dependency (single-lineCargo.lockchange, no version bumps).src/client/connection.rs— the five pass-through wrapper methods (execute,query_one,query,simple_query,batch_execute) now delegate tomz_postgres_util::*. Every call site passes string SQL (no preparedStatement), so the genericToStatementbound is replaced with&str, wrapped viaSql::raw_unchecked— the sanctioned constructor for internally-assembled, already-trusted SQL.src/client/deployment_ops.rs— the two rawTransactioncalls (theSUBSCRIBEcursorexecuteand theFETCH ALLquery) go throughmz_postgres_util::execute/query; the static"FETCH ALL c"usesSql::new.src/client/errors.rs— addFrom<mz_postgres_util::PostgresError> for ConnectionError, mapping thePostgresvariant back toConnectionError::Queryso the existing richas_db_error()formatting is preserved.Testing
No behavioral change; this is a lint-compliance refactor that preserves the existing public API and error formatting of the
Clientwrapper.cargo clippy -p mz-deploy --all-targets -- -D warningsnow passes clean.🤖 Generated with Claude Code