Skip to content

Commit 88196a7

Browse files
committed
allow converting ChannelId into u32
1 parent 800969b commit 88196a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

russh/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,12 @@ impl ChannelOpenFailure {
490490
/// The identifier of a channel.
491491
pub struct ChannelId(u32);
492492

493+
impl From<ChannelId> for u32 {
494+
fn from(c: ChannelId) -> u32 {
495+
c.0
496+
}
497+
}
498+
493499
impl Display for ChannelId {
494500
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
495501
write!(f, "{}", self.0)

0 commit comments

Comments
 (0)