From a6b6ca6965793b3f677bcc7bed4bf4ad3e335a6f Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 20 Mar 2024 11:00:21 +0100 Subject: [PATCH] fix: id extractor --- src/server.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/server.rs b/src/server.rs index be7c2473..1ff01e6e 100644 --- a/src/server.rs +++ b/src/server.rs @@ -63,11 +63,7 @@ impl Context { /// get bare uri, usually an uuid but unspecified pub fn id(&self, id: String) -> String { if id.starts_with(&self.0.domain) { - let mut out = id.replace(&self.0.domain, ""); - if out.ends_with('/') { - out.replace_range(out.len()-1.., ""); - } - out + id.split('/').last().unwrap_or("").to_string() } else { id }