From 2fb740397da7ed15af5aee884d82be316e5c7169 Mon Sep 17 00:00:00 2001 From: Pierce Thompson Date: Wed, 3 Apr 2024 02:14:41 -0400 Subject: [PATCH] Remove utils::ensure_path_prefix Was only used to validated paths passed as query parameters. Now that we match Genius URLs, it's no longer needed --- src/utils.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 2a513f2..50a0cbd 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -17,11 +17,3 @@ pub fn path_from_url(url: &str) -> String { url.splitn(4, '/').last().unwrap().to_owned() } -pub fn ensure_path_prefix(prefix: &'static str, path: &str) -> String { - let path = path.trim_start_matches('/'); - if path.starts_with(prefix) { - path.to_string() - } else { - format!("{}/{}", prefix, path) - } -}