From de5338f4f28b4bfb0bc24dd4c9542603c0eca0f2 Mon Sep 17 00:00:00 2001 From: Trisha Date: Fri, 25 Mar 2022 15:47:34 -0500 Subject: [PATCH] :recycle: refactor: extract routing func --- .../ptth_server/src/file_server/internal.rs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/crates/ptth_server/src/file_server/internal.rs b/crates/ptth_server/src/file_server/internal.rs index c052a35..7a442b7 100644 --- a/crates/ptth_server/src/file_server/internal.rs +++ b/crates/ptth_server/src/file_server/internal.rs @@ -250,6 +250,31 @@ pub struct FileRoots <'a> { pub dirs: &'a BTreeMap , } +struct RoutedPath <'a> { + root: &'a Path, + path: std::borrow::Cow <'a, str>, +} + +impl <'a> FileRoots <'a> { + fn route (self, input: &'a str) -> Result