Closed nerodono closed 1 year ago
Merging #41 (b7b383b) into main (b5b3eca) will decrease coverage by
7.52%
. The diff coverage is83.25%
.
@@ Coverage Diff @@
## main #41 +/- ##
==========================================
- Coverage 96.73% 89.22% -7.52%
==========================================
Files 8 11 +3
Lines 245 334 +89
==========================================
+ Hits 237 298 +61
- Misses 8 36 +28
Files Changed | Coverage Δ | |
---|---|---|
macros/src/case_conversion.rs | 25.00% <25.00%> (ø) |
|
macros/src/impls/try_from_field.rs | 89.13% <89.13%> (ø) |
|
macros/src/impls/try_from_multipart.rs | 93.33% <93.33%> (ø) |
|
macros/src/lib.rs | 100.00% <100.00%> (+5.17%) |
:arrow_up: |
macros/src/util.rs | 95.00% <100.00%> (+1.66%) |
:arrow_up: |
Don't mind the test coverage BTW, it will be fixed when the branch is rebased, same goes for the required checks.
Thanks man will run the status checks and take a look but I think we are good to merge
Looks good man we are only missing a unit test suite for the
case_conversion
module and I think we are good to merge. Let me know if you have time to add it otherwise I can merge and add the tests myself.
Yep, I'll do it right now
Looks good man we are only missing a unit test suite for the
case_conversion
module and I think we are good to merge. Let me know if you have time to add it otherwise I can merge and add the tests myself.
Done
I think the coverage is not picking up the tests in macros folder, will merge anyway and take a look.
This pull requests implements
rename_all
rule for bothTryFromMultipart
andTryFromField
(new) macros, for example:TryFromMultipart
it is equivalent to passing
#[form_data(field_name = <uppercase name of the field>)]
TryFromField
New macro, that can be used to automatically derive
TryFromField
for arbitrary user-specified unit-enum:Under the hood it just loads
String
using itsTryFromField
implementation and maps string to corresponding enum variant, renaming is also available through the#[try_from_field(rename_all = "case")]
and for each individual field via#[field(rename = "name")]
.Also I edited documentation to mention new functionality. Hoping it would be useful!