-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addresses feedback to improve design.
- Loading branch information
1 parent
e4627a9
commit 547cde6
Showing
7 changed files
with
156 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use derive_builder::Builder; | ||
|
||
#[derive(Builder)] | ||
#[builder(build_fn(error(validation_error = false, path = "hello")))] | ||
struct Fee { | ||
hi: u32, | ||
} | ||
|
||
#[derive(Builder)] | ||
#[builder(build_fn(error(validation_error = false), validate = "hello"))] | ||
struct Foo { | ||
hi: u32, | ||
} | ||
|
||
#[derive(Builder)] | ||
#[builder(build_fn(error(path = "hello")))] | ||
struct Fii { | ||
hi: u32, | ||
} | ||
|
||
#[derive(Builder)] | ||
#[builder(build_fn(error()))] | ||
struct Fum { | ||
hi: u32, | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
error: Too many items: Expected no more than 1 | ||
--> tests/compile-fail/build_fn_error.rs:4:20 | ||
| | ||
4 | #[builder(build_fn(error(validation_error = false, path = "hello")))] | ||
| ^^^^^ | ||
|
||
error: Cannot set `error(validation_error = false)` when using `validate` | ||
--> tests/compile-fail/build_fn_error.rs:10:26 | ||
| | ||
10 | #[builder(build_fn(error(validation_error = false), validate = "hello"))] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: Unknown field: `path` | ||
--> tests/compile-fail/build_fn_error.rs:16:26 | ||
| | ||
16 | #[builder(build_fn(error(path = "hello")))] | ||
| ^^^^ | ||
|
||
error: Too few items: Expected at least 1 | ||
--> tests/compile-fail/build_fn_error.rs:22:20 | ||
| | ||
22 | #[builder(build_fn(error()))] | ||
| ^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters