We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 66fa16c + 365aa05 commit 2d84854Copy full SHA for 2d84854
1 file changed
rust/operator-binary/src/framework/types/common.rs
@@ -19,6 +19,18 @@ impl std::fmt::Display for Port {
19
}
20
21
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
34
impl TryFrom<i32> for Port {
35
type Error = Error;
36
@@ -29,12 +41,6 @@ impl TryFrom<i32> for Port {
41
42
43
-impl From<Port> for i32 {
- fn from(value: Port) -> Self {
- value.0 as i32
- }
-}
37
-
38
44
#[cfg(test)]
39
45
mod tests {
40
46
0 commit comments