mirror of
https://github.com/serde-rs/serde.git
synced 2025-09-28 05:21:05 +00:00
Error properly if we get an unknown variant
This commit is contained in:
parent
81dfaa4f3d
commit
7c60fa5276
@ -28,7 +28,7 @@ impl<E, D: Deserializer<E>> Deserializable<E, D> for Animal {
|
||||
|
||||
Ok(Frog(x0, x1))
|
||||
}
|
||||
_ => unreachable!(),
|
||||
_ => Err(d.syntax_error()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user