refactor!: API ergonomics — &[Jid], #[non_exhaustive], PartialEq/Eq - #457
Conversation
BREAKING: Status::send_* methods now take `&[Jid]` instead of `Vec<Jid>`, removing the forced allocation on callers. Existing code using `vec![...]` can switch to `&[...]` or pass `&vec`. Also: - Add #[non_exhaustive] to 9 public enums so new variants aren't breaking - Add PartialEq/Eq to 10+ public structs (GroupMetadata, SendResult, NewsletterMetadata, community types, etc.) - Add PartialEq/Eq to NewsletterVerification, NewsletterState, NewsletterRole
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
@claude review |
|
Claude finished @jlucaso1's task in 45s —— View job Code Review: API Ergonomics Improvements
Verdict: LGTM — clean, well-scoped breaking change. A few minor observations below.
|
Summary
BREAKING: Improves public API ergonomics across features.
&[Jid]instead ofVec<Jid>(HIGH)Status::send_text,send_image,send_video,send_raw,revokenow take&[Jid]instead ofVec<Jid>&[jid1, jid2]or&existing_vecsend_status_messageupdated accordingly#[non_exhaustive]on public enums (MEDIUM)Adding variants to these enums is no longer a semver-breaking change:
StatusPrivacySetting,PresenceStatus,PinDuration,RevokeTypeGroupType,ChatStateTypeNewsletterVerification,NewsletterState,NewsletterRolePartialEq/Eqon public structs (MEDIUM)Users can now compare these types directly:
GroupMetadata,GroupParticipant,CreateGroupResultSendResultNewsletterMetadata,NewsletterVerification,NewsletterState,NewsletterRoleCreateCommunityOptions,CreateCommunityResult,CommunitySubgroupLinkSubgroupsResult,UnlinkSubgroupsResultNot included (deferred)
serdefeature onwacore-binaryforJid— left for a separate PRTest plan
cargo clippy --all --tests— zero warningscargo fmt --all— cleanSummary by CodeRabbit
New Features / Improvements
Chores