-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Stdin:read_line
does not need &mut self
#26890
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
Labels
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Comments
I imagine it's like that because the signature was copied off of the |
Yeah I think it'd be fine to switch to |
Is it quicker for one of you to just do that, or should I submit a PR? |
Go for it! |
See #26897. |
bors
added a commit
that referenced
this issue
Jul 31, 2015
This fixes #26890. To be honest, the local compile-test is still running. This just takes so long. But this looks trivial enough...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently,
Stdin::read_line
takesself
as&mut
. Why is that? The implementation simply locks and callsread_line
on the guard, and locking doesn't need a mutableself
. So this is unnecessary, and the doc doesn't say why this was done. (Nor does the source.)So I propose for this to be changed to
&self
. Looks like an oversight of some refactoring to me.The text was updated successfully, but these errors were encountered: