v0.16.3
Smaller Wasm bundles via js-sys
If the js-sys
feature is enabled, #[garde(pattern)]
will now use js_sys::RegExp
instead of regex::Regex
on the wasm32-unknown-unknown
target. This usually means massive bundle size savings depending on which features you need. The two regex implementations aren't fully compatible, which is why it is opt-in via a feature.
Contributed by @aumetra in #77
Support for newtypes
#[derive(garde::Validate)]
#[garde(transparent)]
struct Username(#[garde(length(min = 3, max = 20))] String);
#[derive(garde::Validate)]
struct User {
// later used with `dive`:
#[garde(dive)]
username: Username,
}
See README.md for more information.
Breaking changes
There were no breaking changes in this release.
Full Changelog: v0.16.2...v0.16.3