Skip to content

Commit e718807

Browse files
committed
remove unused uint24 feature
1 parent 6a44f81 commit e718807

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/util.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,6 @@ pub(crate) fn map_channel_err<T>(err: async_channel::SendError<T>) -> Error {
2929
}
3030

3131
pub(crate) const UINT_24_LENGTH: usize = 3;
32-
#[cfg(feature = "uint24")]
33-
mod uint24 {
34-
use super::UINT_24_LENGTH;
35-
pub struct Uint24LE([u8; UINT_24_LENGTH]);
36-
impl Uint24LE {
37-
pub const MAX_USIZE: usize = 16777215;
38-
pub const SIZE: usize = UINT_24_LENGTH;
39-
}
40-
41-
impl AsRef<[u8; 3]> for Uint24LE {
42-
fn as_ref(&self) -> &[u8; 3] {
43-
&self.0
44-
}
45-
}
46-
47-
// TODO we are using std::io::Error everywhere so I won't add a new one but this isn't ideal
48-
impl TryFrom<usize> for Uint24LE {
49-
type Error = Error;
50-
51-
fn try_from(n: usize) -> Result<Self, Self::Error> {
52-
if n > Self::MAX_USIZE {
53-
todo!()
54-
}
55-
Ok(Self([(n & 255) as u8, (n >> 8) as u8, (n >> 16) as u8]))
56-
}
57-
}
58-
}
5932
#[inline]
6033
pub(crate) fn wrap_uint24_le(data: &[u8]) -> Vec<u8> {
6134
let mut buf: Vec<u8> = vec![0; 3];

0 commit comments

Comments
 (0)