From 47788f56e087d9aaa76e3521cd537f513b2e63d9 Mon Sep 17 00:00:00 2001 From: _ <> Date: Sun, 20 Dec 2020 18:40:49 +0000 Subject: [PATCH] :recycle: refactor: use `use X as Y` --- crates/ptth_server/src/file_server/html.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/ptth_server/src/file_server/html.rs b/crates/ptth_server/src/file_server/html.rs index 498b3d2..325cb30 100644 --- a/crates/ptth_server/src/file_server/html.rs +++ b/crates/ptth_server/src/file_server/html.rs @@ -3,6 +3,10 @@ use std::borrow::Cow; use handlebars::Handlebars; use serde::Serialize; use tracing::instrument; +use tokio::fs::{ + DirEntry as FsDirEntry, + ReadDir as FsReadDir, +}; use super::{ FileServerError, @@ -56,7 +60,7 @@ pub async fn serve_dir ( handlebars: &Handlebars <'static>, instance_metrics: &metrics::Startup, path: Cow <'_, str>, - mut dir: tokio::fs::ReadDir + mut dir: FsReadDir ) -> Result { let mut entries = vec! []; @@ -76,7 +80,7 @@ pub async fn serve_dir ( Ok (serve_html (s)) } -async fn read_dir_entry (entry: tokio::fs::DirEntry) -> DirEntry +async fn read_dir_entry (entry: FsDirEntry) -> DirEntry { use percent_encoding::{ CONTROLS,