Skip to content

Add method Vec<T>::as_mut_ptr() #12945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2014

Conversation

cadencemarseille
Copy link
Contributor

No description provided.


#[inline]
pub fn as_mut_ptr(&mut self) -> *mut T {
self.as_mut_slice().as_mut_ptr()
Copy link
Member

Choose a reason for hiding this comment

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

Can't this just be self.ptr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It probably could, but I think I prefer this way in case specifics of the implementation change. When compiled, it should be optimized as if the method were written as self.ptr, right?

bors added a commit that referenced this pull request Mar 17, 2014
@bors bors closed this Mar 17, 2014
@bors bors merged commit 5db7f7e into rust-lang:master Mar 17, 2014
@cadencemarseille cadencemarseille deleted the vec_ng-as_mut_ptr branch March 17, 2014 11:56
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 27, 2024
Rework `octal_escapes`

Main changes are not doing UTF-8 decoding, noting each occurrence as an individual lint emission, and narrowing the span to point to the escape itself.

changelog: none
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.

4 participants