Skip to content

feat(managed): Add logic so retain can be used both on vec and smallvec#5753

Open
tobias-wilfert wants to merge 4 commits intomasterfrom
tobias-wilfer/feat/add-helper-trait
Open

feat(managed): Add logic so retain can be used both on vec and smallvec#5753
tobias-wilfert wants to merge 4 commits intomasterfrom
tobias-wilfer/feat/add-helper-trait

Conversation

@tobias-wilfert
Copy link
Copy Markdown
Member

While working on #5747 I would ideally have something like this irregardles of if attachments are a vec or a smallvec (items):

pub fn validate(attachments: &mut Managed<SerializedAttachments>) {
    attachments.retain(
        |attachments| &mut attachments.attachments,
        |attachment, _| utils::attachments::validate(attachment),
    );
}

@tobias-wilfert tobias-wilfert marked this pull request as ready for review March 30, 2026 13:25
@tobias-wilfert tobias-wilfert requested a review from a team as a code owner March 30, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants