type-state-builder 0.5.1

Type-state builder pattern derive macro with compile-time safety and enhanced ergonomics.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Debug test for raw identifier issue

use type_state_builder::TypeStateBuilder;

#[test]
fn test_single_raw_identifier() {
    #[derive(TypeStateBuilder)]
    struct TestStruct {
        #[builder(required)]
        r#type: String,
    }

    let instance = TestStruct::builder().r#type("test".to_string()).build();

    assert_eq!(instance.r#type, "test");
}