4 releases
0.1.4 | Jan 20, 2021 |
---|---|
0.1.3 | Jan 6, 2021 |
0.1.2 | Jan 6, 2021 |
0.1.1 | Jan 6, 2021 |
#2358 in Rust patterns
3KB
Deferrer
defer!
macro for deferring functions.
Example
use deferrer::*;
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!");