Skip to content

Commit 6888a7b

Browse files
authored
Merge pull request #23 from noshishiRust/misc/update/validator-crate
update validator crate 0.17.0 -> 0.18.0
2 parents 4550abc + e0cbabe commit 6888a7b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ features = ["full", "aide"]
2727
[dependencies]
2828
axum = { version = "0.7.3", default-features = false }
2929
garde = { version = "0.18.0", optional = true }
30-
validator = { version = "0.17.0", optional = true }
30+
validator = { version = "0.18.0", optional = true }
3131
validify = { version = "1.3.0", optional = true }
3232

3333
[dependencies.axum-extra]
@@ -57,7 +57,7 @@ axum = { version = "0.7.1", features = ["macros"] }
5757
tokio = { version = "1.34.0", features = ["full"] }
5858
reqwest = { version = "0.11.23", features = ["json", "multipart"] }
5959
serde = { version = "1.0.195", features = ["derive"] }
60-
validator = { version = "0.17.0", features = ["derive"] }
60+
validator = { version = "0.18.0", features = ["derive"] }
6161
garde = { version = "0.18.0", features = ["serde", "derive"] }
6262
serde_json = "1.0.108"
6363
serde_yaml = "0.9.27"

src/validator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ pub mod tests {
252252
assert_eq!(&inner, v.deref());
253253
assert_eq!(inner, v.into_inner());
254254

255-
fn validate(v: &i32, args: &DataVA) -> Result<(), ValidationError> {
256-
assert!(*v < args.a);
255+
fn validate(v: i32, args: &DataVA) -> Result<(), ValidationError> {
256+
assert!(v < args.a);
257257
Ok(())
258258
}
259259

src/validator/test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ pub struct ParametersEx {
4747
v1: String,
4848
}
4949

50-
fn validate_v0(v: &i32, args: &ParametersExValidationArguments) -> Result<(), ValidationError> {
50+
fn validate_v0(v: i32, args: &ParametersExValidationArguments) -> Result<(), ValidationError> {
5151
args.inner
5252
.v0_range
53-
.contains(v)
53+
.contains(&v)
5454
.then_some(())
5555
.ok_or_else(|| ValidationError::new("v0 is out of range"))
5656
}
@@ -1208,11 +1208,11 @@ mod extra_typed_path {
12081208
}
12091209

12101210
fn validate_v0(
1211-
v: &i32,
1211+
v: i32,
12121212
args: &TypedPathParamExValidationArguments,
12131213
) -> Result<(), ValidationError> {
12141214
args.v0_range
1215-
.contains(v)
1215+
.contains(&v)
12161216
.then_some(())
12171217
.ok_or_else(|| ValidationError::new("v0 is out of range"))
12181218
}

0 commit comments

Comments
 (0)