diff --git a/validator/tests/display.rs b/validator/tests/display.rs index e6bfa660..1423e602 100644 --- a/validator/tests/display.rs +++ b/validator/tests/display.rs @@ -1,4 +1,4 @@ -#[cfg(derive)] +#[cfg(feature = "derive")] mod tests { use validator::Validate; @@ -17,13 +17,13 @@ mod tests { #[derive(Validate)] struct Bar { - #[validate] + #[validate(nested)] bar: Foo, } #[derive(Validate)] struct DeepBar { - #[validate] + #[validate(nested)] deep_bar: Bar, } @@ -41,7 +41,7 @@ mod tests { #[derive(Validate)] struct Baz { - #[validate] + #[validate(nested)] baz: Vec, } diff --git a/validator_derive_tests/tests/schema.rs b/validator_derive_tests/tests/schema.rs index 970bccd9..dc5ba242 100644 --- a/validator_derive_tests/tests/schema.rs +++ b/validator_derive_tests/tests/schema.rs @@ -24,13 +24,13 @@ mod some_defining_mod { #[derive(Debug, Validate)] #[validate(schema(function = crate::some_validation_mod::valid_schema_fn))] pub struct TestStructValid { - pub val: String, + pub _val: String, } #[derive(Debug, Validate)] #[validate(schema(function = crate::some_validation_mod::invalid_schema_fn))] pub struct TestStructInvalid { - pub val: String, + pub _val: String, } } @@ -50,14 +50,14 @@ mod some_validation_mod { #[test] fn can_validate_fully_qualified_fn_ok() { - let s = some_defining_mod::TestStructValid { val: "hello".into() }; + let s = some_defining_mod::TestStructValid { _val: "hello".into() }; assert!(s.validate().is_ok()); } #[test] fn can_fail_fully_qualified_fn_validation() { - let s = some_defining_mod::TestStructInvalid { val: "hello".into() }; + let s = some_defining_mod::TestStructInvalid { _val: "hello".into() }; let res = s.validate(); assert!(res.is_err());