From 88196a7a96f99e34a317e698351e12ac2d7f53a3 Mon Sep 17 00:00:00 2001 From: Eugene Date: Fri, 28 Jun 2024 21:44:53 +0200 Subject: [PATCH] allow converting ChannelId into u32 --- russh/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/russh/src/lib.rs b/russh/src/lib.rs index 2d764c8c..069906fb 100644 --- a/russh/src/lib.rs +++ b/russh/src/lib.rs @@ -490,6 +490,12 @@ impl ChannelOpenFailure { /// The identifier of a channel. pub struct ChannelId(u32); +impl From 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)