-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Improve docs for mem::forget() #27521
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
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
The PR says mem::swap but this seems to be a mem::forget change? |
lol i am the worst |
a1297da
to
d13be68
Compare
@@ -84,7 +86,7 @@ pub use intrinsics::transmute; | |||
/// mem::forget(file); | |||
/// ``` | |||
/// | |||
/// The swap function uses forget to good effect. | |||
/// The `mem::swap()` function uses forget to good effect: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be weird to include parens here, especially since it actually takes args.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tended to always use parens when talking about a function()
. I guess that's not official style...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I generally don't...? In this case it's clear it's a function anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you wrapped mem::swap
inside the ``, but not mem::forget
?
r=me with nit |
2fd7110
to
5af1b3f
Compare
@bors: r=gankro rollup |
📌 Commit 5af1b3f has been approved by |
We were burying the reason to use this function below a bunch of caveats about its usage. That's backwards. Why a function should be used belongs at the top of the docs, not the bottom. Also, add some extra links to related functions mentioned in the body.
…gankro We were burying the reason to use this function below a bunch of caveats about its usage. That's backwards. Why a function should be used belongs at the top of the docs, not the bottom. Also, add some extra links to related functions mentioned in the body. /cc @abhijeetbhagat who pointed this out on IRC
We were burying the reason to use this function below a bunch of caveats about
its usage. That's backwards. Why a function should be used belongs at the top of
the docs, not the bottom.
Also, add some extra links to related functions mentioned in the body.
/cc @abhijeetbhagat who pointed this out on IRC