diff --git a/src/encoding/hex.rs b/src/encoding/hex.rs index 9158bf7..c3f437d 100644 --- a/src/encoding/hex.rs +++ b/src/encoding/hex.rs @@ -85,7 +85,7 @@ impl fmt::Display for HexByte { } } -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. ///