Skip to content

Added SmallVec::push_mut andSmallVec::insert_mut#406

Open
mematthias wants to merge 3 commits intoservo:v2from
mematthias:add_push_mut
Open

Added SmallVec::push_mut andSmallVec::insert_mut#406
mematthias wants to merge 3 commits intoservo:v2from
mematthias:add_push_mut

Conversation

@mematthias
Copy link
Copy Markdown

The push_mut feature (rust-lang/rust#135974) has already been merged and is expected to be included in the Rust 1.95 stable release. For this reason, we should also add push_mut and insert_mut here.

Additionally, cargo fmt was run.

Copy link
Copy Markdown
Member

@emilio emilio left a comment

Choose a reason for hiding this comment

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

Would be nice to split the formatting into a separate (preliminary?) PR.

src/lib.rs Outdated
unsafe { ptr.write(value) };
unsafe { self.set_len(len + 1) }

let result = unsafe { ptr.as_mut() };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe just &mut *ptr? Or why would as_mut().unwrap_unchecked() be preferred?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That is just my writing style; it makes it easier to search.
I simplified it anyway

Reverted cargo fmt changes
@mematthias mematthias requested a review from emilio March 31, 2026 18:09
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.

2 participants