diff options
author | Martin Fischer <martin@push-f.com> | 2021-06-24 07:35:47 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-06-24 07:38:48 +0200 |
commit | b3e7c889b40a64db20bc52e579938d9c57f1bc3a (patch) | |
tree | 66b37051754493d58b1e4ec4b74ceb63691f9792 /src/main.rs | |
parent | 43b4b8693890a85f24eb358bc5545232ebf8e796 (diff) |
refactor: split up blob routes into functions
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 30f018b..fc0b7ce 100644 --- a/src/main.rs +++ b/src/main.rs @@ -442,7 +442,7 @@ async fn build_response<C: Controller>( .body("redirecting".into()) .unwrap()); } - return get_routes::view_blob(entr, params, controller, ctx); + return get_routes::get_blob(entr, params, controller, ctx); } tree = ctx.repo.find_tree(entr.id()); @@ -528,6 +528,10 @@ impl Context { parent_commits, ) } + + fn file_name(&self) -> Option<&str> { + self.path.file_name().and_then(|x| x.to_str()) + } } fn render_markdown(input: &str) -> String { |