Repository navigation
chore(lint): errors keep their source instead of discarding it in map_err - #717
Draft
PiquelChips wants to merge 1 commit into
Draft
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
What and why
Turns on
clippy::map_err_ignore, somap_err(|_| …)no longer drops the error it converts. All 41 sites are fixed: 19 keep their source, 22 carry an#[expect].Sources kept (19). The error types gain the source:
ChallengeError(InvalidErrorDescription,InvalidMaxAge,InvalidResourceMetadata,NotUtf8),CryptoError(MalformedToken,KeyId,NoteVerifierKeyEncoding,NoteSignatureEncoding),Malformed,TokenError(Malformed,MalformedHeader,InvalidSubject),DiscoveryError::InvalidIssuer,TelemetryError::TimedOutandAdminError::InvalidHandoffReturn(new).TraceId's hex parsing no longer has a fallible step. These are breaking changes to public error types of the SDK and the common crate, which is fine this early.#[expect(clippy::map_err_ignore)](22), each on the smallest statement or function:SecretReference::resolve(OsStringis the secret itself),Secret::parseof the admin handoff state and code, the email-verification and recovery tokens, the passkey assertion (serde_jsonquotes its input), the account export'ssend(returns the unsent chunk), the announcement form's query, andApiError's picture ID.UnspecifiedinRs256VerifyingKey::verifyandSealingKey::open, andTryFromSliceErrorinSecret::parseand four spots ofnote.rswhose lengths were just checked or are fixed by the algorithm (including a hex seed already validated).SignedIn::require'sStepUpandSessionError::StepUpRequired(say what to ask for, not why),InvalidSettingfor a scope (its message lists the allowed scopes), delivery failures (Failureis a storedCopykind, for the address and the destination), and the notification path ID answered as missing. Together with the 9 above that is 22.ApiErrorhas no source field (its causes "only reach the logs"), which is why its three sites are expectations rather than a new design. If you would rather give it one, that is a separate change.Testing
cargo clippy -- -D warningspasses over the workspace and over each crate alone.cargo testpasses forcommon,crypto,auth-sdkandtelemetry, andcargo nextest run -p auth-servicepasses (the database tests are skipped without a scratch cluster).Note
Written by Claude Sonnet 5.5 in Claude Code (via T3 Code)