You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use serde_derive::Deserialize;#[derive(Deserialize)]#[serde(try_from = "bool")]structFoo{#[serde(rename = "foo")]bar:bool,}implTryFrom<bool>forFoo{typeError = std::convert::Infallible;fntry_from(bar:bool) -> Result<Self,Self::Error>{Ok(Foo{ bar })}}
However, I'd argue it should not — serde should probably complain that the #[serde(rename)] will be ignored because of the #[serde(try_from)], as otherwise the user likely made an erroneous assumption.
This may be too breaking a change to do within 1.0, but worth highlighting for the potential future.
The text was updated successfully, but these errors were encountered:
The following code currently compiles:
However, I'd argue it should not — serde should probably complain that the
#[serde(rename)]
will be ignored because of the#[serde(try_from)]
, as otherwise the user likely made an erroneous assumption.This may be too breaking a change to do within 1.0, but worth highlighting for the potential future.
The text was updated successfully, but these errors were encountered: