/// Exhaustively matching on Number in tests
///
/// If you want to ensure that you exhaustively handle every variant, you can
/// match on the hidden `Number::__NonExhaustive` variant.
///
///
/// Matching on this variant means that your code may break when RON is
/// upgraded or when feature unification enables further variants in the
/// Number enum than your code expects.
///
///
/// It is your responsibility to only *ever* match on `Number::__NonExhaustive`
/// inside tests, e.g. by using `#[cfg(test)]` on the particular match arm, to
/// ensure that only your tests break (e.g. in CI) when your code is not
/// exhaustively matching on every variant, e.g. after a version upgrade or
/// feature unification.
///
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Hash, Ord)]
#[cfg_attr(doc, non_exhaustive)]
pub enum Number {
I8(i8),
I16(i16),
I32(i32),
I64(i64),
#[cfg(feature = "integer128")]
I128(i128),
U8(u8),
U16(u16),
U32(u32),
U64(u64),
#[cfg(feature = "integer128")]
U128(u128),
F32(F32),
F64(F64),
#[cfg(not(doc))]
#[allow(private_interfaces)]
__NonExhaustive(private::Never),
}
mod private {
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Hash, Ord)]
pub enum Never {}
}
impl Serialize for Number {
fn serialize