Skip to content

Commit 2a8a54a

Browse files
committed
removed assert as it shouldnt be there
1 parent a4a1c7a commit 2a8a54a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

primitives/src/channel.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ impl FromStr for ChannelId {
7979
type Err = FromHexError;
8080

8181
fn from_str(s: &str) -> Result<Self, Self::Err> {
82-
assert_eq!(s.len(), 66);
83-
assert_eq!(&s[0..2], "0x");
84-
Self::from_hex(&s[2..])
82+
if s.len() != 66 || &s[0..2] != "0x" {
83+
Err(FromHexError::InvalidStringLength)
84+
} else {
85+
Self::from_hex(&s[2..])
86+
}
8587
}
8688
}
8789

0 commit comments

Comments
 (0)