diff --git a/pkstrings/src/pkstring.rs b/pkstrings/src/pkstring.rs index 7f97121..7d044e3 100644 --- a/pkstrings/src/pkstring.rs +++ b/pkstrings/src/pkstring.rs @@ -140,18 +140,6 @@ impl fmt::Display for PKString { } } -impl TryFrom for PKString { - type Error = Error; - - fn try_from(ord: u8) -> Result { - if in_range(ord) { - Ok(PKString(vec![ord])) - } else { - Err(Error::InvalidByte(ord)) - } - } -} - impl TryFrom<&[u8]> for PKString { type Error = Error; diff --git a/pkstrings/src/tests.rs b/pkstrings/src/tests.rs index dec6d6b..74d8dde 100644 --- a/pkstrings/src/tests.rs +++ b/pkstrings/src/tests.rs @@ -20,19 +20,6 @@ const GARY_SLICE_U8: &[u8] = &[0x86, 0x80, 0x91, 0x98]; const GARY_STR: &str = "GARY"; const INVALID_BYTE: u8 = 0x01; -#[test] -fn test_try_from_u8() { - match PKString::try_from(0x80) { // 'A' - Ok(pkstr) => assert_eq!(pkstr, PKString::try_from("A").unwrap()), - Err(_) => panic!(), - } - - match PKString::try_from(INVALID_BYTE) { - Ok(_) => panic!(), - Err(_) => (), - } -} - #[test] fn test_try_from_slice_u8() { match PKString::try_from(GARY_SLICE_U8) {