File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -653,7 +653,7 @@ where
653
653
///
654
654
/// Returns `None` if the given key does not refer to an node in the
655
655
/// bucket.
656
- fn get_mut ( & mut self , key : & Key < TNodeId > ) -> Option < & mut Node < TNodeId , TVal > > {
656
+ pub fn get_mut ( & mut self , key : & Key < TNodeId > ) -> Option < & mut Node < TNodeId , TVal > > {
657
657
self . nodes . iter_mut ( ) . find ( move |p| & p. key == key)
658
658
}
659
659
Original file line number Diff line number Diff line change @@ -128,6 +128,16 @@ where
128
128
. value
129
129
}
130
130
131
+ /// Returns mutable access value associated with the key.
132
+ pub fn value_mut ( & mut self ) -> & mut TVal {
133
+ & mut self
134
+ . 0
135
+ . bucket
136
+ . get_mut ( self . 0 . key )
137
+ . expect ( "We can only build a ConnectedEntry if the entry is in the bucket; QED" )
138
+ . value
139
+ }
140
+
131
141
/// Sets the status of the entry.
132
142
/// This can fail if the new state violates buckets or table conditions.
133
143
pub fn update (
You can’t perform that action at this time.
0 commit comments