diff --git a/src/common.rs b/src/common.rs index 4a9fc999d47977834f69e25ca118e5462a7356d5..dbdbdc02169b6deb0cd7dff6225728b2affb08f1 100644 --- a/src/common.rs +++ b/src/common.rs @@ -34,8 +34,8 @@ pub type U32Suffix = u32; #[derive( Copy, Clone, Eq, PartialEq, Ord, Hash, PartialOrd, serde::Serialize, serde::Deserialize, )] -// acquired via error in the Rust API -pub struct ProtoComponentId(Id); +// pub, because it can be acquired via error in the Rust API +pub struct ComponentId(Id); #[derive( Copy, Clone, Eq, PartialEq, Ord, Hash, PartialOrd, serde::Serialize, serde::Deserialize, )] @@ -99,7 +99,7 @@ impl IdParts for PortId { self.0.id_parts() } } -impl IdParts for ProtoComponentId { +impl IdParts for ComponentId { fn id_parts(self) -> (ConnectorId, U32Suffix) { self.0.id_parts() } @@ -122,8 +122,8 @@ impl From for PortId { Self(id) } } -impl From for ProtoComponentId { - fn from(id: Id) -> ProtoComponentId { +impl From for ComponentId { + fn from(id: Id) -> Self { Self(id) } } @@ -184,7 +184,7 @@ impl Debug for PortId { write!(f, "pid{}_{}", a, b) } } -impl Debug for ProtoComponentId { +impl Debug for ComponentId { fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { let (a, b) = self.id_parts(); write!(f, "cid{}_{}", a, b)