Skip to content

Releases: tomoikey/typesafe_builder

v1.6

16 Aug 04:02

Choose a tag to compare

What's Changed

  • feat: add support for #[builder(default)] attribute without expression by @tomoikey in #10

Full Changelog: v1.5...v1.6

v1.5

07 Aug 23:50

Choose a tag to compare

What's Changed

  • feat: add support for #[builder(into)] attribute by @tomoikey in #9

Full Changelog: v1.4...v1.5

v1.4

04 Jun 19:40
2472fbe

Choose a tag to compare

What's Changed

Full Changelog: v1.3...v1.4

v1.3

04 Jun 04:39

Choose a tag to compare

What's Changed

Full Changelog: v1.2...v1.3

v1.2

02 Jun 18:52
d129602

Choose a tag to compare

What's Changed

fn lifetime_and_generic_struct_success() {
    #[derive(Builder, PartialEq)]
    struct ComplexConfig<'a, T> {
        #[builder(required)]
        name: &'a str,
        #[builder(optional)]
        value: Option<T>,
    }

    let config1: ComplexConfig<'_, i32> = ComplexConfigBuilder::new().with_name("test").build();
    assert_eq!(config1.name, "test");
    assert_eq!(config1.value, None);

    let config2 = ComplexConfigBuilder::new()
        .with_name("test")
        .with_value(100i32)
        .build();
    assert_eq!(config2.name, "test");
    assert_eq!(config2.value, Some(100));
}
fn generic_struct_where_clause_success() {
    #[derive(Builder)]
    struct Container<T>
    where
        T: Clone,
    {
        #[builder(required)]
        value: T,
    }

    let container = ContainerBuilder::new().with_value(42i32).build();
    assert_eq!(container.value, 42);

    let container = ContainerBuilder::new()
        .with_value("hello".to_string())
        .build();
    assert_eq!(container.value, "hello");
}

New Contributors

Full Changelog: v1.1...v1.2

v1.1

02 Jun 17:29

Choose a tag to compare

What's Changed

  • Enforce Option for fields with optional, required_if, or optional_… by @ramsyana in #2

New Contributors

Full Changelog: https://github.com/tomoikey/typesafe_builder/commits/v1.0

🚀 Just released stable version !!!

02 Jun 17:28

Choose a tag to compare

✨ Features:

  • Compile-time type safety
  • Complex conditional logic (AND/OR/NOT)
  • required_if / optional_if for dynamic constraints

Perfect for eliminating bugs at the type level. Check it out!