Added floating point formatting
+ Supports single and double precession formatting + Added Error handling from the formatting functions
This commit is contained in:
3 files changed
+107
-22
No files matched your search
@@ -1,8 +1,18 @@
|
||||
use std::fmt::{Display, Formatter};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum ByteStreamError {
|
||||
OutOfRange,
|
||||
}
|
||||
|
||||
impl Display for ByteStreamError {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
ByteStreamError::OutOfRange => write!(f, "Request values out of range")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn bit_mask(mask: u8) -> u8 {
|
||||
match mask {
|
||||
0 => 0x00,
|
||||
|
||||
Reference in new issue
Block a user