Junzhuo ZHOU
Junzhuo ZHOU
> But please only one feature at a time: either mut Helper or Parser but not both in the same PR. Understand, and since the `Parser::parse` requires `&mut self`, I...
Here is the update under your suggestions. I think the `Invoke` should impl for `LineBuffer` and `String`, rather than `State` and `&str`. The `&str` could be replaced to `String` since...
Or at least use a part of `State` to create a `ValidationContext`? Since here we already make a mutable reference from `State.helper`, then it's difficult to have another mutable refence...
And I notice that the `fn (&T) -> Result` way is also compatible with https://github.com/ohkami-rs/serdev
> I'll need to read up on the issue discussions and the extent to which we may want to simplify `validator` crate support The most user friendly API should like...
Great, I will do that
Now we have two ways to use `validator`: ``` rust #[derive(validator::Validate, Deserialize)] #[serde(validate = "validator::Validate::validate")] struct ValidateStruct { #[validate(email)] mail: String, } #[derive(validator::Validate, Deserialize)] #[serde(validator)] struct ValidatorStruct { #[validate(email)] mail:...
Now there can be multiple validations, I add two test cases 1. Multiple `serde(validate = "...")`, see [here](https://github.com/zao111222333/serde/blob/e611d5f12555ed50dfa4b6c605e016f2d3126f08/test_suite/tests/test_validate.rs#L5-L10) 2. Both `serde(validate = "...")` and `serde(validator)`, see [here](https://github.com/zao111222333/serde/blob/e611d5f12555ed50dfa4b6c605e016f2d3126f08/test_suite/tests/test_validate.rs#L201-L207)
Hi @Mingun, thank you for your review. > What the advantage of using `#[serde(validator)]` over `#[serde(validate = "...")]`? It seems to me that this is unnecessary introduction of implicit dependency....
Hi, I am wondering is there any suggestions for this PR? So that I can modify under that. Take your time and thank you!