File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,15 @@ impl<U: UserData> std::ops::Deref for DatabaseImpl<U> {
196
196
}
197
197
}
198
198
199
+ impl < U : UserData > std:: ops:: DerefMut for DatabaseImpl < U > {
200
+ fn deref_mut ( & mut self ) -> & mut U {
201
+ self . zalsa_mut ( )
202
+ . user_data_mut ( )
203
+ . downcast_mut :: < U > ( )
204
+ . unwrap ( )
205
+ }
206
+ }
207
+
199
208
impl < U : UserData + RefUnwindSafe > RefUnwindSafe for DatabaseImpl < U > { }
200
209
201
210
#[ salsa_macros:: db]
Original file line number Diff line number Diff line change @@ -179,6 +179,10 @@ impl Zalsa {
179
179
& * self . user_data
180
180
}
181
181
182
+ pub ( crate ) fn user_data_mut ( & mut self ) -> & mut ( dyn Any + Send + Sync ) {
183
+ & mut * self . user_data
184
+ }
185
+
182
186
/// Triggers a new revision. Invoked automatically when you call `zalsa_mut`
183
187
/// and so doesn't need to be called otherwise.
184
188
pub ( crate ) fn new_revision ( & mut self ) -> Revision {
You can’t perform that action at this time.
0 commit comments