Skip to content

Commit e55b610

Browse files
authored
Merge pull request #39 from meilisearch/update-dependencies
Update dependencies
2 parents 7a0c2a6 + f6a9de2 commit e55b610

File tree

15 files changed

+137
-136
lines changed

15 files changed

+137
-136
lines changed

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "deserr"
3-
version = "0.6.0"
3+
version = "0.6.2"
44
authors = ["Lo <[email protected]>", "Tamo <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
description = "Deserialization library with focus on error handling"
@@ -13,11 +13,11 @@ edition = "2021"
1313
[dependencies]
1414
serde_json = { version = "1.0", optional = true }
1515
serde-cs = { version = "0.2.4", optional = true }
16-
actix-web = { version = "4.3.0", default-features = false, optional = true }
17-
futures = { version = "0.3.25", optional = true }
18-
deserr-internal = { version = "=0.6.0", path = "derive" }
19-
strsim = "0.10.0"
20-
actix-http = { version = "3.3.0", optional = true }
16+
actix-web = { version = "4.8.0", default-features = false, optional = true }
17+
futures = { version = "0.3.30", optional = true }
18+
deserr-internal = { version = "=0.6.2", path = "derive" }
19+
strsim = "0.11.1"
20+
actix-http = { version = "3.8.0", optional = true }
2121
actix-utils = { version = "3.0.1", optional = true }
2222
serde_urlencoded = "0.7.1"
2323

@@ -29,11 +29,11 @@ actix-web = ["dep:actix-web", "futures", "actix-http", "actix-utils"]
2929

3030
[dev-dependencies]
3131
automod = "1.0"
32-
insta = { version = "1.23.0", features = ["json"] }
32+
insta = { version = "1.39.0", features = ["json"] }
3333
rustversion = "1.0"
3434
serde = { version = "1.0", features = ["derive"] }
3535
serde_derive = "1.0"
36-
trybuild = { version = "1.0.49", features = ["diff"] }
36+
trybuild = { version = "1.0.96", features = ["diff"] }
3737

3838
[workspace]
3939
members = ["derive", "examples/*"]

derive/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "deserr-internal"
3-
version = "0.6.0"
3+
version = "0.6.2"
44
authors = ["Lo <[email protected]>", "Tamo <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
description = "Derive macros for Deserr. Use the re-exports from the deserr crate instead."
@@ -12,7 +12,7 @@ proc-macro = true
1212

1313
[dependencies]
1414
proc-macro2 = "1.0"
15-
quote = "1.0.2"
15+
quote = "1.0.36"
1616
syn = { version = "2.0", features=["extra-traits", "parsing"]}
1717
convert_case = "0.6.0"
1818

examples/actix_web_server/Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
actix-http = { version = "3.2.2", default-features = false, features = ["compress-brotli", "compress-gzip", "rustls"] }
10-
actix-web = { version = "4.2.1", default-features = false, features = ["macros", "compress-brotli", "compress-gzip", "cookies", "rustls"] }
11-
anyhow = "1.0.68"
9+
actix-http = { version = "3.8.0", default-features = false, features = ["compress-brotli", "compress-gzip", "rustls"] }
10+
actix-web = { version = "4.8.0", default-features = false, features = ["macros", "compress-brotli", "compress-gzip", "cookies", "rustls"] }
11+
anyhow = "1.0.86"
1212
deserr = { path = "../../", features = ["actix-web"] }
13-
env_logger = "0.10.0"
14-
futures = "0.3.25"
15-
futures-util = "0.3.25"
16-
log = "0.4.17"
17-
serde = { version = "1.0.152", features = ["derive"] }
18-
serde_json = "1.0.91"
13+
env_logger = "0.11.3"
14+
futures = "0.3.30"
15+
futures-util = "0.3.30"
16+
log = "0.4.22"
17+
serde = { version = "1.0.203", features = ["derive"] }
18+
serde_json = "1.0.120"

examples/implements_deserr_manually.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct Query {
1717
/// - `"jorts"`
1818
/// - `["jorts", "jean"]`
1919
/// - `["jorts", ["bilbo", "bob"], "jean"]`
20+
#[allow(dead_code)]
2021
#[derive(Debug)]
2122
enum Filter {
2223
Array(Vec<Filter>),
@@ -111,12 +112,12 @@ fn main() {
111112

112113
// And when an error arise, we get the nice error from the json error handler.
113114
let error = deserialize::<Filter, _, JsonError>(json!(["jorts", "is", ["a", 10]])).unwrap_err();
114-
insta::assert_display_snapshot!(error, @"Invalid value type at `[2][1]`: expected a string or an array, but found a positive integer: `10`");
115+
insta::assert_snapshot!(error, @"Invalid value type at `[2][1]`: expected a string or an array, but found a positive integer: `10`");
115116

116117
// But since we're generic over the error type we can as well switch to query parameter error!
117118
let error =
118119
deserialize::<Filter, _, QueryParamError>(json!(["jorts", "is", "a", 10])).unwrap_err();
119-
insta::assert_display_snapshot!(error, @"Invalid value type for parameter `[3]`: expected a string, but found an integer: `10`");
120+
insta::assert_snapshot!(error, @"Invalid value type for parameter `[3]`: expected a string, but found an integer: `10`");
120121

121122
// And as expected, using this `Filter` type from another struct that got its `Deserr` implementation from the derive macro just works.
122123
let filter =

src/errors/json.rs

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -232,24 +232,24 @@ mod tests {
232232

233233
#[test]
234234
fn test_value_kinds_description_json() {
235-
insta::assert_display_snapshot!(value_kinds_description_json(&[]), @"a different value");
236-
237-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Boolean]), @"a boolean");
238-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Integer]), @"a positive integer");
239-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::NegativeInteger]), @"a negative integer");
240-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Integer]), @"a positive integer");
241-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::String]), @"a string");
242-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Sequence]), @"an array");
243-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Map]), @"an object");
244-
245-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Integer, ValueKind::Boolean]), @"a boolean or a positive integer");
246-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Null, ValueKind::Integer]), @"null or a positive integer");
247-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Sequence, ValueKind::NegativeInteger]), @"a negative integer or an array");
248-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Integer, ValueKind::Float]), @"a number");
249-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Integer, ValueKind::Float, ValueKind::NegativeInteger]), @"a number");
250-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Integer, ValueKind::Float, ValueKind::NegativeInteger, ValueKind::Null]), @"null or a number");
251-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Boolean, ValueKind::Integer, ValueKind::Float, ValueKind::NegativeInteger, ValueKind::Null]), @"null, a boolean, or a number");
252-
insta::assert_display_snapshot!(value_kinds_description_json(&[ValueKind::Null, ValueKind::Boolean, ValueKind::Integer, ValueKind::Float, ValueKind::NegativeInteger, ValueKind::Null]), @"null, a boolean, or a number");
235+
insta::assert_snapshot!(value_kinds_description_json(&[]), @"a different value");
236+
237+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Boolean]), @"a boolean");
238+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Integer]), @"a positive integer");
239+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::NegativeInteger]), @"a negative integer");
240+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Integer]), @"a positive integer");
241+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::String]), @"a string");
242+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Sequence]), @"an array");
243+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Map]), @"an object");
244+
245+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Integer, ValueKind::Boolean]), @"a boolean or a positive integer");
246+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Null, ValueKind::Integer]), @"null or a positive integer");
247+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Sequence, ValueKind::NegativeInteger]), @"a negative integer or an array");
248+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Integer, ValueKind::Float]), @"a number");
249+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Integer, ValueKind::Float, ValueKind::NegativeInteger]), @"a number");
250+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Integer, ValueKind::Float, ValueKind::NegativeInteger, ValueKind::Null]), @"null or a number");
251+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Boolean, ValueKind::Integer, ValueKind::Float, ValueKind::NegativeInteger, ValueKind::Null]), @"null, a boolean, or a number");
252+
insta::assert_snapshot!(value_kinds_description_json(&[ValueKind::Null, ValueKind::Boolean, ValueKind::Integer, ValueKind::Float, ValueKind::NegativeInteger, ValueKind::Null]), @"null, a boolean, or a number");
253253
}
254254

255255
#[test]
@@ -261,7 +261,7 @@ mod tests {
261261
}
262262
let value = json!({ "toto": 2 });
263263
let err = deserr::deserialize::<Missing, _, JsonError>(value).unwrap_err();
264-
insta::assert_display_snapshot!(err, @"Missing field `me`");
264+
insta::assert_snapshot!(err, @"Missing field `me`");
265265
}
266266

267267
#[test]
@@ -273,7 +273,7 @@ mod tests {
273273
}
274274
let value = json!({ "me": [2] });
275275
let err = deserr::deserialize::<Incorrect, _, JsonError>(value).unwrap_err();
276-
insta::assert_display_snapshot!(err, @"Invalid value type at `.me`: expected a positive integer, but found an array: `[2]`");
276+
insta::assert_snapshot!(err, @"Invalid value type at `.me`: expected a positive integer, but found an array: `[2]`");
277277

278278
#[allow(dead_code)]
279279
#[derive(deserr::Deserr, Debug)]
@@ -290,7 +290,7 @@ mod tests {
290290
}
291291
let value = json!({ "me": "la" });
292292
let err = deserr::deserialize::<MultiIncorrect, _, JsonError>(value).unwrap_err();
293-
insta::assert_display_snapshot!(err, @"Unknown value `la` at `.me`: expected one of `One`, `Two`, `Three`");
293+
insta::assert_snapshot!(err, @"Unknown value `la` at `.me`: expected one of `One`, `Two`, `Three`");
294294

295295
#[allow(dead_code)]
296296
#[derive(deserr::Deserr, Debug)]
@@ -307,7 +307,7 @@ mod tests {
307307
}
308308
let value = json!({ "me": "la" });
309309
let err = deserr::deserialize::<MultiIncorrectWithRename, _, JsonError>(value).unwrap_err();
310-
insta::assert_display_snapshot!(err, @"Unknown value `la` at `.me`: expected one of `theobjectivecamelisnoice`, `bloup`");
310+
insta::assert_snapshot!(err, @"Unknown value `la` at `.me`: expected one of `theobjectivecamelisnoice`, `bloup`");
311311
}
312312

313313
#[test]
@@ -320,7 +320,7 @@ mod tests {
320320
}
321321
let value = json!({ "me": 2, "u": "uwu" });
322322
let err = deserr::deserialize::<SingleUnknownField, _, JsonError>(value).unwrap_err();
323-
insta::assert_display_snapshot!(err, @"Unknown field `u`: expected one of `me`");
323+
insta::assert_snapshot!(err, @"Unknown field `u`: expected one of `me`");
324324

325325
#[allow(dead_code)]
326326
#[derive(deserr::Deserr, Debug)]
@@ -331,7 +331,7 @@ mod tests {
331331
}
332332
let value = json!({ "me": 2, "and": "u", "uwu": "OwO" });
333333
let err = deserr::deserialize::<MultiUnknownField, _, JsonError>(value).unwrap_err();
334-
insta::assert_display_snapshot!(err, @"Unknown field `uwu`: expected one of `me`, `and`");
334+
insta::assert_snapshot!(err, @"Unknown field `uwu`: expected one of `me`, `and`");
335335
}
336336

337337
#[test]
@@ -344,11 +344,11 @@ mod tests {
344344
}
345345
let value = json!({ "me": [2] });
346346
let err = deserr::deserialize::<UnexpectedTuple, _, JsonError>(value).unwrap_err();
347-
insta::assert_display_snapshot!(err, @"Invalid value at `.me`: the sequence should have exactly 2 elements");
347+
insta::assert_snapshot!(err, @"Invalid value at `.me`: the sequence should have exactly 2 elements");
348348

349349
let value = json!({ "me": [2, 3, 4] });
350350
let err = deserr::deserialize::<UnexpectedTuple, _, JsonError>(value).unwrap_err();
351-
insta::assert_display_snapshot!(err, @"Invalid value at `.me`: the sequence should have exactly 2 elements");
351+
insta::assert_snapshot!(err, @"Invalid value at `.me`: the sequence should have exactly 2 elements");
352352
}
353353

354354
#[test]
@@ -374,72 +374,72 @@ mod tests {
374374

375375
let value = json!({ "filler": "doggo" });
376376
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
377-
insta::assert_display_snapshot!(err, @"Unknown field `filler`: did you mean `filter`? expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
377+
insta::assert_snapshot!(err, @"Unknown field `filler`: did you mean `filter`? expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
378378

379379
let value = json!({ "sart": "doggo" });
380380
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
381-
insta::assert_display_snapshot!(err, @"Unknown field `sart`: did you mean `sort`? expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
381+
insta::assert_snapshot!(err, @"Unknown field `sart`: did you mean `sort`? expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
382382

383383
let value = json!({ "attributes_to_highlight": "doggo" });
384384
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
385-
insta::assert_display_snapshot!(err, @"Unknown field `attributes_to_highlight`: did you mean `attributesToHighlight`? expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
385+
insta::assert_snapshot!(err, @"Unknown field `attributes_to_highlight`: did you mean `attributesToHighlight`? expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
386386

387387
let value = json!({ "attributesToHighloght": "doggo" });
388388
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
389-
insta::assert_display_snapshot!(err, @"Unknown field `attributesToHighloght`: did you mean `attributesToHighlight`? expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
389+
insta::assert_snapshot!(err, @"Unknown field `attributesToHighloght`: did you mean `attributesToHighlight`? expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
390390

391391
// doesn't match anything
392392

393393
let value = json!({ "a": "doggo" });
394394
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
395-
insta::assert_display_snapshot!(err, @"Unknown field `a`: expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
395+
insta::assert_snapshot!(err, @"Unknown field `a`: expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
396396

397397
let value = json!({ "query": "doggo" });
398398
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
399-
insta::assert_display_snapshot!(err, @"Unknown field `query`: expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
399+
insta::assert_snapshot!(err, @"Unknown field `query`: expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
400400

401401
let value = json!({ "filterable": "doggo" });
402402
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
403-
insta::assert_display_snapshot!(err, @"Unknown field `filterable`: expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
403+
insta::assert_snapshot!(err, @"Unknown field `filterable`: expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
404404

405405
let value = json!({ "sortable": "doggo" });
406406
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
407-
insta::assert_display_snapshot!(err, @"Unknown field `sortable`: expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
407+
insta::assert_snapshot!(err, @"Unknown field `sortable`: expected one of `q`, `filter`, `sort`, `attributesToHighlight`");
408408

409409
// did you mean triggered by an unknown value
410410

411411
let value = json!({ "q": "filler" });
412412
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
413-
insta::assert_display_snapshot!(err, @"Unknown value `filler` at `.q`: did you mean `filter`? expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
413+
insta::assert_snapshot!(err, @"Unknown value `filler` at `.q`: did you mean `filter`? expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
414414

415415
let value = json!({ "q": "sart" });
416416
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
417-
insta::assert_display_snapshot!(err, @"Unknown value `sart` at `.q`: did you mean `sort`? expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
417+
insta::assert_snapshot!(err, @"Unknown value `sart` at `.q`: did you mean `sort`? expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
418418

419419
let value = json!({ "q": "attributes_to_highlight" });
420420
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
421-
insta::assert_display_snapshot!(err, @"Unknown value `attributes_to_highlight` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
421+
insta::assert_snapshot!(err, @"Unknown value `attributes_to_highlight` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
422422

423423
let value = json!({ "q": "attributesToHighloght" });
424424
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
425-
insta::assert_display_snapshot!(err, @"Unknown value `attributesToHighloght` at `.q`: did you mean `attributesToHighLight`? expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
425+
insta::assert_snapshot!(err, @"Unknown value `attributesToHighloght` at `.q`: did you mean `attributesToHighLight`? expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
426426

427427
// doesn't match anything
428428

429429
let value = json!({ "q": "a" });
430430
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
431-
insta::assert_display_snapshot!(err, @"Unknown value `a` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
431+
insta::assert_snapshot!(err, @"Unknown value `a` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
432432

433433
let value = json!({ "q": "query" });
434434
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
435-
insta::assert_display_snapshot!(err, @"Unknown value `query` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
435+
insta::assert_snapshot!(err, @"Unknown value `query` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
436436

437437
let value = json!({ "q": "filterable" });
438438
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
439-
insta::assert_display_snapshot!(err, @"Unknown value `filterable` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
439+
insta::assert_snapshot!(err, @"Unknown value `filterable` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
440440

441441
let value = json!({ "q": "sortable" });
442442
let err = deserr::deserialize::<DidYouMean, _, JsonError>(value).unwrap_err();
443-
insta::assert_display_snapshot!(err, @"Unknown value `sortable` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
443+
insta::assert_snapshot!(err, @"Unknown value `sortable` at `.q`: expected one of `q`, `filter`, `sort`, `attributesToHighLight`");
444444
}
445445
}

0 commit comments

Comments
 (0)