mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
Rollup merge of #37523 - d-unseductable:deref_mut_lifetimes, r=bluss
Elide lifetimes in DerefMut documentation - Elide lifetimes to increase the readability of `DerefMut` examples
This commit is contained in:
commit
0befab2343
@ -2484,13 +2484,13 @@ impl<'a, T: ?Sized> Deref for &'a mut T {
|
||||
/// impl<T> Deref for DerefMutExample<T> {
|
||||
/// type Target = T;
|
||||
///
|
||||
/// fn deref<'a>(&'a self) -> &'a T {
|
||||
/// fn deref(&self) -> &T {
|
||||
/// &self.value
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// impl<T> DerefMut for DerefMutExample<T> {
|
||||
/// fn deref_mut<'a>(&'a mut self) -> &'a mut T {
|
||||
/// fn deref_mut(&mut self) -> &mut T {
|
||||
/// &mut self.value
|
||||
/// }
|
||||
/// }
|
||||
|
Loading…
Reference in New Issue
Block a user