(&mut self)
| 4602 | |
| 4603 | impl SyncResult { |
| 4604 | fn take(&mut self) -> Result<Option<Option<ValRaw>>> { |
| 4605 | Ok(match mem::replace(self, SyncResult::Taken) { |
| 4606 | SyncResult::NotProduced => None, |
| 4607 | SyncResult::Produced(val) => Some(val), |
| 4608 | SyncResult::Taken => { |
| 4609 | bail_bug!("attempted to take a synchronous result that was already taken") |
| 4610 | } |
| 4611 | }) |
| 4612 | } |
| 4613 | } |
| 4614 | |
| 4615 | #[derive(Debug)] |