Releases: mathematic-inc/unfmt
v0.3.0
unfmt v0.3.0 brings a polished, production-ready release of the beloved inverse string formatting library — complete with a shiny new Apache-2.0 license, a thoroughly restructured CI/CD pipeline, and refined crate metadata that makes the package a first-class citizen on crates.io. Whether you're parsing log lines, dissecting protocol messages, or reversing any format!-style output, unfmt continues to be the most ergonomic tool for the job in the Rust ecosystem.
✨ What is unfmt?
unfmt gives you format! in reverse. Pass a format string and an input string, and get back typed values — with zero regex, zero manual parsing, and full compile-time safety.
use unfmt::unformat;
// Extract values from a formatted string
let Some((host, port)) = unformat!("{}:{:u16}", "localhost:8080") else { return };
println!("host={host}, port={port}"); // host=localhost, port=8080
// Named captures write directly into your variables
let mut status = None;
let mut code = None;
unformat!("HTTP/{status} {code:u16}", "HTTP/1.1 200");
assert_eq!(status, Some("1.1"));
assert_eq!(code, Some(200u16));
// Full-match mode — require the entire string to match
assert_eq!(unformat!("({:u8}, {:u8})", "(1, 2)", true), Some((1, 2)));
assert_eq!(unformat!("({:u8}, {:u8})", "foo(1, 2)", true), None); // prefix not allowed
assert_eq!(unformat!("({:u8}, {:u8})", "(1, 2)bar", true), None); // suffix not allowed
// Indexed captures let you reorder the returned tuple
let Some((second, first)) = unformat!("{1} then {0}", "B then A") else { return };
assert_eq!((first, second), ("A", "B"));🔓 License
unfmt is now published under the Apache-2.0 license, making it clear and unambiguous for use in commercial and open-source projects alike.
⚡ Improvements
- CI/CD overhaul: Workflows have been restructured for reliability and maintainability, with a fix for the Rust toolchain input in the release pipeline — ensuring smooth, reproducible releases going forward.
- Crate metadata refinement:
Cargo.tomlmetadata has been polished so the crate presents well on crates.io with accurate descriptions, categories, and keywords.
📦 Installation
Add unfmt to your Cargo.toml:
[dependencies]
unfmt = "0.3.0"Then import and use the macro:
use unfmt::unformat;
fn main() {
if let Some((name, score)) = unformat!("{} scored {:u32} points", "Alice scored 42 points") {
println!("{name} got {score}!");
}
}Thanks to everyone who has used, reported issues, and contributed to unfmt — this release is for you!
v0.2.3
0.2.3 (2026-03-11)
Bug Fixes
- deps: Update cargo (#147) (95c0a65)
- deps: Update cargo (#85) (e8174a7)
- deps: Update rust crate proc-macro2 to v1.0.84 (#98) (a0739a3)
- deps: Update rust crate proc-macro2 to v1.0.85 (#107) (9a467d7)
- deps: Update rust crate syn to v2.0.64 (#76) (89c4b2f)
- deps: Update rust crate syn to v2.0.66 (#90) (40fd131)
- deps: Update rust crate syn to v2.0.68 (#156) (18ca21f)
- Restructure CI/CD workflows, update license to Apache-2.0, and refine crate metadata (#191) (7ff766f)
What's Changed
- docs: add docs about full match by @jrandolf in #74
- chore(deps): update actions/checkout digest to a5ac7e5 by @renovate[bot] in #75
- fix(deps): update rust crate syn to v2.0.64 by @renovate[bot] in #76
- chore(deps): update taiki-e/install-action digest to e7cd6f1 by @renovate[bot] in #78
- docs: fix the code in README.md by @magistau in #80
- chore(deps): update taiki-e/install-action digest to fce5fd6 by @renovate[bot] in #81
- chore(deps): update taiki-e/install-action digest to 3c93f2e by @renovate[bot] in #82
- chore(deps): update taiki-e/install-action digest to 68c5e86 by @renovate[bot] in #83
- chore(deps): update taiki-e/install-action digest to 689459d by @renovate[bot] in #84
- fix(deps): update cargo by @renovate[bot] in #85
- chore(deps): update github-actions by @renovate[bot] in #86
- chore(deps): update taiki-e/install-action digest to 0fc5600 by @renovate[bot] in #87
- chore(deps): update taiki-e/install-action digest to 4fedbdd by @renovate[bot] in #88
- chore(deps): update taiki-e/install-action digest to 7491b90 by @renovate[bot] in #89
- fix(deps): update rust crate syn to v2.0.66 by @renovate[bot] in #90
- chore(deps): update taiki-e/install-action digest to f1a3491 by @renovate[bot] in #91
- chore(deps): update dependency cargo-deny to v0.14.24 by @renovate[bot] in #92
- chore(deps): update taiki-e/install-action digest to 2190a01 by @renovate[bot] in #93
- chore(deps): update taiki-e/install-action digest to c3531c8 by @renovate[bot] in #94
- chore(deps): update taiki-e/install-action digest to 9c2797b by @renovate[bot] in #95
- chore(deps): update taiki-e/install-action digest to 70765aa by @renovate[bot] in #96
- chore(deps): update taiki-e/install-action digest to c2bb13f by @renovate[bot] in #97
- fix(deps): update rust crate proc-macro2 to v1.0.84 by @renovate[bot] in #98
- chore(deps): update taiki-e/install-action digest to ccdec58 by @renovate[bot] in #99
- chore(deps): update taiki-e/install-action digest to 60784cb by @renovate[bot] in #100
- chore(deps): update taiki-e/install-action digest to 51b8ba0 by @renovate[bot] in #101
- chore(deps): update romeovs/lcov-reporter-action digest to 87a815f by @renovate[bot] in #102
- chore(deps): update taiki-e/install-action digest to 08b0c77 by @renovate[bot] in #103
- chore(deps): update taiki-e/install-action digest to e5240ce by @renovate[bot] in #104
- chore(deps): update dependency cargo-llvm-cov to v0.6.10 by @renovate[bot] in #105
- chore(deps): update taiki-e/install-action digest to 4e38715 by @renovate[bot] in #106
- fix(deps): update rust crate proc-macro2 to v1.0.85 by @renovate[bot] in #107
- chore(deps): update taiki-e/install-action digest to 1014a1e by @renovate[bot] in #108
- chore(deps): update taiki-e/install-action digest to 9b00020 by @renovate[bot] in #109
- chore(deps): update taiki-e/install-action digest to 03897c7 by @renovate[bot] in #110
- chore(deps): update taiki-e/install-action digest to 8faf1ae by @renovate[bot] in #111
- chore(deps): update taiki-e/install-action digest to 8de2a00 by @renovate[bot] in #112
- chore(deps): update taiki-e/install-action digest to eb4a68d by @renovate[bot] in #113
- chore(deps): update taiki-e/install-action digest to 45b6915 by @renovate[bot] in #114
- chore(deps): update taiki-e/install-action digest to 3eb90b2 by @renovate[bot] in #115
- chore(deps): update taiki-e/install-action digest to 16647ab by @renovate[bot] in #116
- chore(deps): update taiki-e/install-action digest to 66c4dcc by @renovate[bot] in #117
- chore(deps): update taiki-e/install-action digest to f9c15f1 by @renovate[bot] in #118
- chore(deps): update taiki-e/install-action digest to 23b90ae by @renovate[bot] in #119
- chore(deps): update taiki-e/install-action digest to 762078b by @renovate[bot] in #120
- chore(deps): update taiki-e/install-action digest to 5a6e4c7 by @renovate[bot] in #121
- chore(deps): update taiki-e/install-action digest to f6578d8 by @renovate[bot] in #122
- chore(deps): update taiki-e/install-action digest to d0c2bb4 by @renovate[bot] in #123
- chore(deps): update taiki-e/install-action digest to 3c1a9d6 by @renovate[bot] in #124
- chore(deps): update taiki-e/install-action digest to ca13ba3 by @renovate[bot] in #125
- chore(deps): update taiki-e/install-action digest to 0a18e24 by @renovate[bot] in #126
- chore(deps): update taiki-e/install-action digest to 01c63d2 by @renovate[bot] in #128
- chore(deps): update taiki-e/install-action digest to 07a34f8 by @renovate[bot] in #129
- chore(deps): update actions/checkout digest to b17fe1e by @renovate[bot] in #130
- chore(deps): update github-actions by @renovate[bot] in #131
- chore(deps): update taiki-e/install-action digest to 309ee82 by @renovate[bot] in #132
- chore(deps): update taiki-e/install-action digest to 19a89ed by @renovate[bot] in #133
- chore(deps): update taiki-e/install-action digest to 3e3b268 by @renovate[bot] in #134
- chore(deps): update taiki-e/install-action digest to 2bc1761 by @renovate[bot] in #135
- chore(deps): update taiki-e/install-action digest to a8a128c by @renovate[bot] in #136
- chore(deps): update taiki-e/install-action digest to 69538e2 by @renovate[bot] in #137
- chore(deps): update taiki-e/install-action digest to 6a5e5c2 by @renovate[bot] in #138
- chore(deps): update taiki-e/install-action digest to 47943d5 by @renovate[bot] in #139
- chore(deps): update taiki-e/install-action digest to 0ed897e by @renovate[b...
v0.2.2
0.2.2 (2024-05-14)
Bug Fixes
- deps: Update rust crate proc-macro2 to v1.0.82 (#58) (e2bee12)
- deps: Update rust crate syn to v2.0.61 (#56) (d5fc873)
- deps: Update rust crate syn to v2.0.62 (#65) (e7192e7)
- deps: Update rust crate syn to v2.0.63 (#69) (8b3f3cd)
- Parse
syn::Litinstead ofsyn::Expr(#72) (c3621f8)
Dependencies
- The following workspace dependencies were updated
- dependencies
- unfmt_macros bumped from 0.2.1 to 0.2.2
- dependencies