Closed
Description
Using: VS Code with RLS, Windows
This produces clippy warning on option_option
:
#[allow(clippy::option_option)]
#[serde(deserialize_with = "func")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
#[serde(borrow)]
foo: Option<Option<Cow<'a, str>>>,
consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases.
However, removing #[serde(deserialize_with ... )]
makes it work:
#[allow(clippy::option_option)]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
#[serde(borrow)]
foo: Option<Option<Cow<'a, str>>>,
I suspect #[serde(serialize_with ...)]
will also trip up this feature. So something about serde
's serialize_with
and deserialize_with
attributes conflict with option_option
.