Skip to content

Commit 2d84854

Browse files
Merge branch 'main' into feat/service-discovery-and-exposition
2 parents 66fa16c + 365aa05 commit 2d84854

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

  • rust/operator-binary/src/framework/types

rust/operator-binary/src/framework/types/common.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ impl std::fmt::Display for Port {
1919
}
2020
}
2121

22+
impl From<u16> for Port {
23+
fn from(value: u16) -> Self {
24+
Port(value)
25+
}
26+
}
27+
28+
impl From<Port> for i32 {
29+
fn from(value: Port) -> Self {
30+
value.0 as i32
31+
}
32+
}
33+
2234
impl TryFrom<i32> for Port {
2335
type Error = Error;
2436

@@ -29,12 +41,6 @@ impl TryFrom<i32> for Port {
2941
}
3042
}
3143

32-
impl From<Port> for i32 {
33-
fn from(value: Port) -> Self {
34-
value.0 as i32
35-
}
36-
}
37-
3844
#[cfg(test)]
3945
mod tests {
4046

0 commit comments

Comments
 (0)