Seal the encoding::hex::Encode trait

This commit is contained in:
Pantonshire committed 2022-08-18 11:54:06 +01:00
1 parent eff2fab679
commit cf2648dde6
1 file changed
+8 -1
+8 -1
View File
@@ -85,7 +85,7 @@ impl<E: Encode> fmt::Display for HexByte<E> {
}
}
pub trait Encode {
pub trait Encode: sealed::Sealed {
fn byte_to_hex(byte: u8) -> (u8, u8);
}
@@ -107,6 +107,13 @@ impl Encode for Uppercase {
}
}
mod sealed {
pub trait Sealed {}
impl Sealed for super::Lowercase {}
impl Sealed for super::Uppercase {}
}
/// Converts the given byte to its lowercase hexadecimal representation. The first byte returned
/// encodes the most significant 4 bits, and the second byte encodes the least significant 4 bits.
///