mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-25 06:10:32 +08:00
When deserializing through `serde_json::from_value` the following
error would occur:
panicked at 'called Result::unwrap() on an Err value: Error("invalid
type: string "master", expected a borrowed string", line: 0, column:
0)'
To fix this it is necessary for the Deserialize implementations to
deserialize into an owned String and convert from there.
While attempting to test this the `Qualified` and `Namespaced`
implementations were not able to be used:
error: implementation of `serde::de::Deserialize` is not general enough
--> git-ref-format/t/src/properties/name.rs:86:9
|
86 | roundtrip::json_value(qualified);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `serde::de::Deserialize` is not general enough
|
= note: `Qualified<'_>` must implement `serde::de::Deserialize<'0>`, for any lifetime `'0`...
= note: ...but `Qualified<'_>` actually implements
`serde::de::Deserialize<'1>`, for some specific lifetime `'1`
The Deserialize for both of those types now return owned data by
returning a 'static lifetime instead.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
30 lines
435 B
TOML
30 lines
435 B
TOML
[package]
|
|
name = "git-ref-format-test"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
license = "GPL-3.0-or-later"
|
|
|
|
publish = false
|
|
|
|
[lib]
|
|
doctest = false
|
|
test = true
|
|
doc = false
|
|
|
|
[features]
|
|
test = []
|
|
|
|
[dependencies]
|
|
proptest = "1"
|
|
|
|
[dev-dependencies]
|
|
assert_matches = "1.5"
|
|
serde_json = "1"
|
|
|
|
[dev-dependencies.git-ref-format]
|
|
path = ".."
|
|
features = ["macro", "minicbor", "serde"]
|
|
|
|
[dev-dependencies.test-helpers]
|
|
path = "../../test/test-helpers"
|