| Crates.io | einmalig |
| lib.rs | einmalig |
| version | 1.0.0 |
| created_at | 2025-08-06 17:26:46.276775+00 |
| updated_at | 2025-08-06 17:26:46.276775+00 |
| description | A tiny crate that allows unsizing `FnOnce` functions without boxing. |
| homepage | |
| repository | https://github.com/mattfbacon/einmalig |
| max_upload_size | |
| id | 1784100 |
| size | 16,354 |
A tiny crate that allows unsizing FnOnce functions without boxing.
use einmalig::{DynFnOnce, dyn_fnonce};
fn add(f: impl FnOnce(&str) -> String) -> String {
add_dyn(dyn_fnonce!(f))
}
fn add_dyn(f: DynFnOnce<'_, &str, String>) -> String {
f.call("malig!")
}
let prefix = "ein".to_owned();
assert_eq!("einmalig!", add(|x| prefix + x));
MIT OR Apache-2.0