From 99720e030c300efc124bda42f7dd04e0cf96efa4 Mon Sep 17 00:00:00 2001 From: Hayleigh Thompson Date: Thu, 16 Jul 2026 09:06:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20some=20minor=20bugs=20with?= =?UTF-8?q?=20nsid=20parsing.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/at/nsid.gleam | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/at/nsid.gleam b/src/at/nsid.gleam index 95a0c22..6631899 100644 --- a/src/at/nsid.gleam +++ b/src/at/nsid.gleam @@ -111,7 +111,8 @@ fn do_from_string( "" -> // The name segment must not start with a digit. case string.slice(input, slice_offset, slice_length) { - "1" <> _ + "0" <> _ + | "1" <> _ | "2" <> _ | "3" <> _ | "4" <> _ @@ -171,7 +172,7 @@ fn do_from_string( // An authority segment cannot start or end with a hyphen. "-." <> _ -> Error(Nil) - "-" if slice_length == 0 -> Error(Nil) + "-" <> _ if slice_length == 0 -> Error(Nil) // The first authority segment cannot start with a digit. "0" <> _ -- 2.51.2