Skip to content

v0.14.1

Compare
Choose a tag to compare
@jprochazk jprochazk released this 25 Aug 09:30
· 158 commits to main since this release

What's Changed

#65 by @aumetra

You can now bind the context to a variable, and the length and byte_length rules min and max values may now contain arbitrary expressions. This means the following is now possible:

struct Config {
    min_length: usize,
}

#[derive(garde::Validate)]
#[garde(context(Config as conf))]
struct Foo {
    #[garde(length(
        min = conf.min_length,
        max = self.baz.len()
    ))]
    bar: String,
    #[garde(skip)]
    baz: String,
}

New Contributors

Full Changelog: v0.14.0...v0.14.1