(&mut self, x: &mut T, f: F)
| 417 | /// returns, the reference will be popped off the stack. |
| 418 | #[cfg(feature = "std")] |
| 419 | pub fn with_append<F, R>(&mut self, x: &mut T, f: F) -> R |
| 420 | where |
| 421 | F: FnOnce(&mut Self) -> R, |
| 422 | { |
| 423 | self.v.push(x.into()); |
| 424 | let res = std::panic::catch_unwind(core::panic::AssertUnwindSafe(|| f(self))); |
| 425 | self.v.pop(); |
| 426 | res.unwrap_or_else(|x| std::panic::resume_unwind(x)) |
| 427 | } |
| 428 | |
| 429 | /// Appends a reference to this stack for the duration of the function `f`. When `f` |
| 430 | /// returns, the reference will be popped off the stack. |
no test coverage detected