deferrer

Crates.iodeferrer
lib.rsdeferrer
version0.1.4
sourcesrc
created_at2021-01-06 08:27:44.673967
updated_at2021-01-20 08:51:02.387713
descriptiondefer! macro for deferring functions.
homepage
repository
max_upload_size
id332957
size2,978
(oilaba)

documentation

README

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!");
Commit count: 0

cargo fmt