File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ fn named_struct_custom_closure_vec_errors_is_err() {
286286fn filed_custom_validation_using_self ( ) {
287287 fn food_validation ( kind : & str , food : & str ) -> Result < ( ) , serde_valid:: validation:: Error > {
288288 match kind {
289- "cat " => {
289+ "Cat " => {
290290 if food == "CatFood" {
291291 Ok ( ( ) )
292292 } else {
@@ -295,7 +295,7 @@ fn filed_custom_validation_using_self() {
295295 ) )
296296 }
297297 }
298- "dog " => {
298+ "Dog " => {
299299 if food == "DogFood" {
300300 Ok ( ( ) )
301301 } else {
@@ -310,21 +310,21 @@ fn filed_custom_validation_using_self() {
310310
311311 #[ derive( Validate ) ]
312312 struct Pet {
313- #[ validate( enumerate = [ "cat " , "dog " ] ) ]
313+ #[ validate( enumerate = [ "Cat " , "Dog " ] ) ]
314314 kind : String ,
315315
316316 #[ validate( custom = |food| food_validation( & self . kind, food) ) ]
317317 food : String ,
318318 }
319319
320320 let cat = Pet {
321- kind : "cat " . to_string ( ) ,
321+ kind : "Cat " . to_string ( ) ,
322322 food : "CatFood" . to_string ( ) ,
323323 } ;
324324 assert ! ( cat. validate( ) . is_ok( ) ) ;
325325
326326 let invalid = Pet {
327- kind : "cat " . to_string ( ) ,
327+ kind : "Cat " . to_string ( ) ,
328328 food : "DogFood" . to_string ( ) ,
329329 } ;
330330
You can’t perform that action at this time.
0 commit comments