From 645bc0a060bab6435ac39db18d128009f331b347 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 31 Mar 2022 00:57:24 +0100 Subject: [PATCH] zcoord: Move from_str impl for Mutable to be FromStr impl Suggested by clippy. Signed-off-by: Ian Jackson --- base/zcoord.rs | 5 ++++- wasm/wasm.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/base/zcoord.rs b/base/zcoord.rs index ebdeda6f..dcee587d 100644 --- a/base/zcoord.rs +++ b/base/zcoord.rs @@ -493,9 +493,12 @@ impl Mutable { }), } } +} +impl FromStr for Mutable { + type Err = ParseError; #[throws(ParseError)] - pub fn from_str(s: &str) -> Mutable { + fn from_str(s: &str) -> Mutable { let tail = ZCoord::checked(s)?; Mutable::from_u8_unchecked(tail) } diff --git a/wasm/wasm.rs b/wasm/wasm.rs index 77f2bd5b..251ec7cb 100644 --- a/wasm/wasm.rs +++ b/wasm/wasm.rs @@ -8,6 +8,7 @@ use otter_base::imports::*; use std::fmt::Display; use std::collections::hash_map::HashMap; +use std::str::FromStr; use extend::ext; use fehler::throws; -- 2.30.2