[−][src]Macro deferrer::defer
Used for deferring a FnOnce()
. Deferred functions will called at the end of the scope.
Example
use deferrer::defer; use std::cell::RefCell; let mut s = RefCell::new(String::from("Hello")); { defer!( || s.borrow_mut().push_str(" world!") ); assert_eq!(*s.borrow(), "Hello"); } assert_eq!(*s.borrow(), "Hello world!");