[][src]Macro cursive::once1

macro_rules! once1 {
    ($f:expr) => { ... };
}

Macro to wrap a FnOnce with 1 argument into a FnMut.

This can wrap any FnOnce with a single argument (for example &mut Cursive).

Note

If the resulting function is called multiple times, only the first call will trigger the wrapped FnOnce. All subsequent calls will be no-ops.

In addition, due to weird interaction between Higher-rank trait bounds and closures, you should use the result from the macro directly, and not assign it to a variable.