Skip to content

Commit

Permalink
allow converting ChannelId into u32
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Jun 28, 2024
1 parent 800969b commit 88196a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions russh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,12 @@ impl ChannelOpenFailure {
/// The identifier of a channel.
pub struct ChannelId(u32);

impl From<ChannelId> for u32 {
fn from(c: ChannelId) -> u32 {
c.0
}
}

impl Display for ChannelId {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
Expand Down

0 comments on commit 88196a7

Please sign in to comment.