File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
rust/catalyst-types/src/id_uri Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,6 @@ pub enum IdUriError {
3232 InvalidRotationValue ( #[ from] KeyRotationError ) ,
3333 /// Encryption key Identifier Fragment is not valid
3434 InvalidEncryptionKeyFragment ,
35+ /// Invalid Text encoding
36+ InvalidTextEncoding ( #[ from] std:: string:: FromUtf8Error ) ,
3537}
Original file line number Diff line number Diff line change @@ -395,7 +395,7 @@ impl FromStr for IdUri {
395395 let mut cat_id = Self :: new ( network, subnet, role0_pk)
396396 . with_role ( role_index)
397397 . with_rotation ( rotation) ;
398-
398+
399399 if uri. has_fragment ( ) {
400400 if uri. fragment ( ) == Some ( Self :: ENCRYPTION_FRAGMENT ) {
401401 cat_id = cat_id. with_encryption ( ) ;
@@ -476,7 +476,7 @@ impl TryFrom<&[u8]> for IdUri {
476476 type Error = errors:: IdUriError ;
477477
478478 fn try_from ( value : & [ u8 ] ) -> Result < Self , Self :: Error > {
479- let kid_str = String :: from_utf8_lossy ( value) ;
479+ let kid_str = String :: from_utf8 ( value. to_vec ( ) ) ? ;
480480 IdUri :: from_str ( & kid_str)
481481 }
482482}
You can’t perform that action at this time.
0 commit comments