witty-crayon-22786
08/19/2020, 8:43 PMwitty-crayon-22786
08/19/2020, 8:44 PMwitty-crayon-22786
08/19/2020, 8:44 PMStarting
messagewitty-crayon-22786
08/19/2020, 8:47 PMhundreds-breakfast-49010
08/19/2020, 8:48 PMwitty-crayon-22786
08/19/2020, 8:48 PMwitty-crayon-22786
08/19/2020, 8:48 PMwitty-crayon-22786
08/19/2020, 8:49 PMstruct Guard(S);
impl Drop for Guard {
fn drop(&mut self) {
self.0.clean_up()
}
}
witty-crayon-22786
08/19/2020, 8:49 PMwitty-crayon-22786
08/19/2020, 8:52 PMguard.thing_to_maybe_cleanup.take()
… then Drop only calls the workunit canceled if the value is still there.