From 0d4755f7a37b3a4836371e6377615d20e4e42b99 Mon Sep 17 00:00:00 2001 From: Fuyin Date: Thu, 22 Feb 2024 19:55:27 +0800 Subject: [PATCH] fix: underflow when parsing `DerivationSeg` --- derive/src/path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/derive/src/path.rs b/derive/src/path.rs index f4816a6..0b38190 100644 --- a/derive/src/path.rs +++ b/derive/src/path.rs @@ -133,7 +133,7 @@ where fn from_str(s: &str) -> Result { let t = s.trim_start_matches('<').trim_end_matches('>'); - if t.len() == s.len() - 2 { + if t.len() + 2 == s.len() { let set = t.split(';').map(I::from_str).collect::, _>>()?; Ok(Self(Confined::try_from_iter(set)?)) } else {