From fada53044dc0a5630010c6a4aa4d2c01c1f4c9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Thu, 3 Jul 2025 13:07:09 +0000 Subject: [PATCH] `sharry::ids` formatting --- src/sharry/ids.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/sharry/ids.rs b/src/sharry/ids.rs index 57a5cd2..4e0a1c4 100644 --- a/src/sharry/ids.rs +++ b/src/sharry/ids.rs @@ -54,13 +54,13 @@ impl TryFrom for FileID { fn try_from(value: String) -> crate::Result { /// Pattern breakdown: - /// - `^([^:/?#]+)://` – scheme (anything but `:/?#`) + `"://"` - /// - `([^/?#]+)` – authority/host (anything but `/?#`) - /// - `/api/v2/alias/upload/` – literal path segment - /// - `([^/]+)` – capture SID (one or more non-slash chars) - /// - `/files/tus/` – literal path segment - /// - `(?P[^/]+)` – capture FID (one or more non-slash chars) - /// - `$` – end of string + /// - `^([^:/?#]+)://` - scheme (anything but `:/?#`) + `"://"` + /// - `([^/?#]+)` - authority/host (anything but `/?#`) + /// - `/api/v2/alias/upload/` - literal path segment + /// - `([^/]+)` - capture SID (one or more non-slash chars) + /// - `/files/tus/` - literal path segment + /// - `(?P[^/]+)` - capture FID (one or more non-slash chars) + /// - `$` - end of string static UPLOAD_URL_RE: LazyLock = LazyLock::new(|| { trace!("compiling UPLOAD_URL_RE"); @@ -82,7 +82,7 @@ impl TryFrom for FileID { Ok(result) } else { Err(crate::Error::mismatch( - ":///api/v2/alias/upload//files/tus/", + ":///api/v2/alias/upload//files/tus/", value, )) } @@ -143,7 +143,7 @@ mod tests { match err { crate::Error::Mismatch { expected, actual } => { assert_eq!( - expected, ":///api/v2/alias/upload//files/tus/", + expected, ":///api/v2/alias/upload//files/tus/", "Error should output expected format" ); assert_eq!(actual, bad.to_string(), "Error should echo back the input");