Skip to content

Commit 95d1614

Browse files
committed
add a mutable getter on stops
1 parent 57a982e commit 95d1614

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/id.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ impl<T> Collection<T> {
8989
self.0.get(id)
9090
}
9191

92+
/// Get a mutable reference on the object associated to the typed [Id]
93+
pub fn get_mut(&mut self, id: &Id<T>) -> Option<&mut T> {
94+
self.0.get_mut(id)
95+
}
96+
9297
/// Returns the number of objects in the [Collection]
9398
pub fn len(&self) -> usize {
9499
self.0.len()

0 commit comments

Comments
 (0)