diff --git a/testcontainers/src/core/ports.rs b/testcontainers/src/core/ports.rs index 14b88e68..bde94ac4 100644 --- a/testcontainers/src/core/ports.rs +++ b/testcontainers/src/core/ports.rs @@ -67,13 +67,13 @@ impl Ports { } /// Returns the host port for the given internal container's port, on the host's IPv4 interfaces. - pub fn map_to_host_port_ipv4(&self, container_port: ContainerPort) -> Option { - self.ipv4_mapping.get(&container_port).cloned() + pub fn map_to_host_port_ipv4(&self, container_port: impl Into) -> Option { + self.ipv4_mapping.get(&container_port.into()).cloned() } /// Returns the host port for the given internal container's port, on the host's IPv6 interfaces. - pub fn map_to_host_port_ipv6(&self, container_port: ContainerPort) -> Option { - self.ipv6_mapping.get(&container_port).cloned() + pub fn map_to_host_port_ipv6(&self, container_port: impl Into) -> Option { + self.ipv6_mapping.get(&container_port.into()).cloned() } }