@testeronious to [email protected] • 9 months agounfmt: A compile-time pattern matching library that reverses the interpolation process of format!.github.comexternal-linkmessage-square9arrow-up159arrow-down11
arrow-up158arrow-down1external-linkunfmt: A compile-time pattern matching library that reverses the interpolation process of format!.github.com@testeronious to [email protected] • 9 months agomessage-square9
minus-squareEpheralinkfedilink21•edit-29 months agoYou must’ve read that wrong. The first example, but formatted differently: let value = "My name is Rho."; let result = unformat!("My {} is {}.", value); Now, result contains: Some(("name", "Rho")) …because the words “name” and “Rho” in value happened to be at the position of the {}-slots in the unformat!()-pattern.
minus-square@[email protected]linkfedilinkEnglish5•9 months agoOh yeah! Thanks. It’s been a long day. Anti Commercial-AI license
You must’ve read that wrong.
The first example, but formatted differently:
let value = "My name is Rho."; let result = unformat!("My {} is {}.", value);
Now,
result
contains:Some(("name", "Rho"))
…because the words “name” and “Rho” in
value
happened to be at the position of the {}-slots in the unformat!()-pattern.Oh yeah! Thanks. It’s been a long day.
Anti Commercial-AI license