[go: up one dir, main page]

float16/
error.rs

1//! Error type for numeric conversion functions.
2
3use core::fmt;
4
5/// The error type returned when a checked integral type conversion fails.
6pub struct TryFromFloatError(pub(crate) ());
7
8impl fmt::Display for TryFromFloatError {
9    #[inline]
10    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11        let msg = "out of range integral type conversion attempted";
12        fmt::Display::fmt(msg, f)
13    }
14}