Skip to content

Annotating OneOrMany errors? #779

Answered by jonasbb
wez asked this question in Q&A
Sep 10, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The error message you see is part of the DeserializeAs implementation of OneOrMany. As such it is not really possible to change it, as this would require modifying the DeserializeAs code. In the future maybe it might be possible to refer to a const generic static string, but that is impossible right now too.

#[cfg(feature = "alloc")]
impl<'de, T, TAs, FORMAT> DeserializeAs<'de, Vec<T>> for OneOrMany<TAs, FORMAT>
where
TAs: DeserializeAs<'de, T>,
FORMAT: Format,
{
fn deserialize_as<D>(deserializer: D) -> Result<Vec<T>, D::Error>
where
D: Deserializer<'de>,
{
let

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wez
Comment options

Answer selected by wez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants