Add test of remote enum with non_exhaustive
This commit is contained in:
parent
45271c3676
commit
cb490ec16d
@ -125,6 +125,9 @@ struct Test {
|
||||
|
||||
#[serde(with = "EnumConcrete")]
|
||||
enum_concrete: remote::EnumGeneric<u8>,
|
||||
|
||||
#[serde(with = "ErrorKindDef")]
|
||||
io_error_kind: std::io::ErrorKind,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
@ -197,6 +200,15 @@ enum EnumConcrete {
|
||||
Variant(u8),
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(remote = "std::io::ErrorKind")]
|
||||
#[non_exhaustive]
|
||||
enum ErrorKindDef {
|
||||
NotFound,
|
||||
PermissionDenied,
|
||||
// ...
|
||||
}
|
||||
|
||||
impl From<PrimitivePrivDef> for remote::PrimitivePriv {
|
||||
fn from(def: PrimitivePrivDef) -> Self {
|
||||
remote::PrimitivePriv::new(def.0)
|
||||
|
Loading…
Reference in New Issue
Block a user