Skip to content

Commit

Permalink
Fix warnings in tests (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
veigaribo authored Nov 3, 2024
1 parent 6dd0525 commit 6f22a17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions validator/tests/display.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(derive)]
#[cfg(feature = "derive")]
mod tests {
use validator::Validate;

Expand All @@ -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,
}

Expand All @@ -41,7 +41,7 @@ mod tests {

#[derive(Validate)]
struct Baz {
#[validate]
#[validate(nested)]
baz: Vec<Foo>,
}

Expand Down
8 changes: 4 additions & 4 deletions validator_derive_tests/tests/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand All @@ -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());
Expand Down

0 comments on commit 6f22a17

Please sign in to comment.