chore: restrict what should be pub or not

This commit is contained in:
2021-06-06 20:47:11 -05:00
parent 878edd4082
commit ef4e54aba6
10 changed files with 176 additions and 153 deletions

View File

@@ -1,6 +1,5 @@
use super::{BLACK, DARK_GRAY, LIGHT_GRAY, WHITE};
use bitfield::bitfield;
use std::convert::TryInto;
bitfield! {
pub struct LCDStatus(u8);
@@ -435,20 +434,6 @@ impl GrayShade {
GrayShade::Black => BLACK,
}
}
pub(crate) fn from_rgba(slice: &[u8]) -> Self {
let rgba: [u8; 4] = slice
.try_into()
.expect("Unable to interpret &[u8] as [u8; 4]");
match rgba {
WHITE => GrayShade::White,
LIGHT_GRAY => GrayShade::LightGray,
DARK_GRAY => GrayShade::DarkGray,
BLACK => GrayShade::Black,
_ => panic!("{:#04X?} is not a colour the DMG-01 supports", rgba),
}
}
}
impl Default for GrayShade {