Seal the encoding::hex::Encode trait
This commit is contained in:
1 parent
eff2fab679
commit
cf2648dde6
1 file changed
+8
-1
+8
-1
@@ -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);
|
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
|
/// 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.
|
/// encodes the most significant 4 bits, and the second byte encodes the least significant 4 bits.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in new issue
Block a user