Skip to content

Commit

Permalink
documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
campeis committed Dec 1, 2023
1 parent c532159 commit 8587073
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,28 @@ fn main() {
```

### Allow field value to be set multiple times
By default the builder will not allow a field to be set multiple times.

Because of this the following code would not compile.

```rust
use type_safe_builder_macro::Builder;

#[derive(Builder)]
struct Struct {
field: String,
}

fn main() {
let build = StructBuilder::builder()
.field("value".into())
.field("another value".into()) //this will mot compile
.build();
}
```

This behaviour could be changed on a field by field basis.

```rust
use type_safe_builder_macro::Builder;

Expand Down

0 comments on commit 8587073

Please sign in to comment.