Skip to content

chore: fix the new clippy lint in tests - #120

Closed
felipefreitag wants to merge 1 commit into
mainfrom
chore/fix-new-clippy-lint
Closed

felipefreitag wants to merge 1 commit into
mainfrom
chore/fix-new-clippy-lint

Conversation

@felipefreitag

@felipefreitag felipefreitag commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

What fails

The Lint job fails on every open PR, for example #119. Clippy reports 11 errors in old tests in src/emails.rs, src/events.rs and src/templates.rs.

Why

Rust 1.99.0 adds the clippy::assert_is_empty lint. The lint rejects assert!(x.is_empty()) and assert!(!x.is_empty()). CI uses the latest stable toolchain and runs clippy with -Dwarnings, so each warning is an error.

What changed

  • Each flagged assert!(x.is_empty()) is now assert_eq! against an empty value. Each assert!(!x.is_empty()) is now assert_ne!.
  • For Vec fields, the empty value is Vec::<T>::new(). Clippy suggests [] as [T; 0], but the crate denies trivial_casts, so that form does not compile.
  • For the url string, the empty value is "", as clippy suggests.

The assertions check the same conditions as before. Only test code changes, so there is no version bump.

Verification

  • cargo clippy --all-targets -- -Dwarnings passes for the async, rustls-tls and blocking configurations, with clippy 0.1.99.
  • cargo fmt --check and cargo build pass.
  • The offline tests that changed pass. The live share_email test needs RESEND_API_KEY and runs in CI.

This unblocks the Lint check on open PRs such as #119.


Summary by cubic

Fixes the failing Lint job on all open PRs by updating test assertions to satisfy the new clippy::assert_is_empty lint added in Rust 1.99.0.

  • Replaces assert!(x.is_empty()) with assert_eq! and assert!(!x.is_empty()) with assert_ne! in test code in src/emails.rs, src/events.rs, and src/templates.rs.
  • Uses Vec::<T>::new() as the empty value instead of [] as [T; 0], which the crate cannot compile because it denies trivial_casts.
  • Only test code changes, so there is no version bump.

Written for commit 6bd0b84. Summary will update on new commits.

View guided diff

@klotty klotty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Test-only change that rewrites is_empty assertions as assert_eq!/assert_ne! to satisfy a new Clippy lint, preserving the asserted behavior and unblocking CI.

View guided diff | Re-trigger cubic

@AntoniosBarotsis

Copy link
Copy Markdown
Collaborator

I saw this after updating them myself manually so I think its fine to close (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants