Skip to content

Commit 7a96a25

Browse files
committed
feat: add DerefMut implementation for FileSnapshot.
This allows to leverage `make_mut()`.
1 parent a8333f1 commit 7a96a25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gix-fs/src/snapshot.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ impl<T: std::fmt::Debug> Deref for FileSnapshot<T> {
5757
}
5858
}
5959

60+
impl<T: std::fmt::Debug> std::ops::DerefMut for FileSnapshot<T> {
61+
fn deref_mut(&mut self) -> &mut Self::Target {
62+
&mut self.value
63+
}
64+
}
65+
6066
impl<T: std::fmt::Debug> Deref for SharedFileSnapshotMut<T> {
6167
type Target = MutableOnDemand<Option<SharedFileSnapshot<T>>>;
6268

0 commit comments

Comments
 (0)