einmalig

Crates.ioeinmalig
lib.rseinmalig
version1.0.0
created_at2025-08-06 17:26:46.276775+00
updated_at2025-08-06 17:26:46.276775+00
descriptionA tiny crate that allows unsizing `FnOnce` functions without boxing.
homepage
repositoryhttps://github.com/mattfbacon/einmalig
max_upload_size
id1784100
size16,354
Matt Fellenz (mattfbacon)

documentation

README

Einmalig!

A tiny crate that allows unsizing FnOnce functions without boxing.

Usage

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));

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt