Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRename .as_mut() to .as_mut_ref() in Option/Result/AnyMutRefExt #14299
Conversation
This comment has been minimized.
This comment has been minimized.
|
The reasoning behind naming it |
This comment has been minimized.
This comment has been minimized.
|
Every other library method I've looked at that has
|
This comment has been minimized.
This comment has been minimized.
|
This may need some more context to take action on it before moving forward. I view I know that @aturon has recently been analyzing our patterns throughout the stdlib, and I know he'd be interested in this. |
This comment has been minimized.
This comment has been minimized.
|
I was motivated to do this because I tried to write code and just used The only context where I would be interested to hear what @aturon has to say on this subject. |
This comment has been minimized.
This comment has been minimized.
|
There's a clear convention about mutable variants of On the other hand, the Personally, I tend to agree with @kballard: part of the help of conventions is that you (and your finger muscles) don't have to remember special cases, even if that sometimes means typing more. Two other points.
|
This comment has been minimized.
This comment has been minimized.
|
@aturon Do you think we should hold off on resolving this local consistency issue until #13660 is resolved? I don't think there's a need to wait on that (especially because, as I commented in #13660, I think having Also, until such time as a decision is made to rename |
This comment has been minimized.
This comment has been minimized.
|
@kballard I would not be opposed to resolving this ahead of #13660 if there was clear consensus about it, since the underlying, informal convention is otherwise consistent. OTOH, if there is going to be a debate on this name, it should connect to the wider debate around #13660, which is asking for a formal convention around I also agree about the name change for `&mut T. Just something to keep in mind. As far as I can tell, this is a unique exception to the usual |
This comment has been minimized.
This comment has been minimized.
|
Some thoughts that went into the original decision:
They're not very strong arguments in the face of the rest of the standard library, however. I'd also be fine with resolving this ahead of #13660 and the mut/uniq debate. May as well get everything in to line first. |
This comment has been minimized.
This comment has been minimized.
|
Closing due to inactivity, but these naming issues with mutability definitely need to be resolved for 1.0! |
lilyball commentedMay 19, 2014
For consistency with other naming patterns, rename .as_mut() to
.as_mut_ref().
Leave .as_mut() as a deprecated function.
[breaking-change]