Skip to content

Commit

Permalink
Remove utils::ensure_path_prefix
Browse files Browse the repository at this point in the history
Was only used to validated paths passed as query parameters. Now that we match Genius URLs, it's no longer needed
  • Loading branch information
Insprill committed Apr 3, 2024
1 parent d27c5b6 commit 9a63aa9
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,3 @@ pub fn borrowed_u8_eq(a: &u8, b: &u8) -> bool {
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)
}
}

0 comments on commit 9a63aa9

Please sign in to comment.