From fe5cb428277a12a54e8d46e229d1c37c51201658 Mon Sep 17 00:00:00 2001 From: Marc Nijdam Date: Fri, 24 May 2024 17:28:39 -0400 Subject: [PATCH] impl FromStr for HotspotLocation --- helium-lib/src/hotspot.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helium-lib/src/hotspot.rs b/helium-lib/src/hotspot.rs index dc28515a..c0e21fbf 100644 --- a/helium-lib/src/hotspot.rs +++ b/helium-lib/src/hotspot.rs @@ -743,6 +743,13 @@ impl TryFrom for HotspotLocation { } } +impl FromStr for HotspotLocation { + type Err = h3o::error::InvalidCellIndex; + fn from_str(s: &str) -> StdResult { + s.parse::().map(Into::into) + } +} + impl HotspotLocation { pub fn from_maybe>(value: Option) -> Option { value.and_then(|v| TryInto::try_into(v).ok())