Added floating point formatting

+ Supports single and double precession formatting
+ Added Error handling from the formatting functions
This commit is contained in:
joeyahines committed 2021-10-09 09:30:02 -06:00
1 parent 9e5b0aafbd
commit 652682cb19
3 files changed
+107 -22

No files matched your search

+10
View File
@@ -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,