♻️ refactor: use `use X as Y`

main
_ 2020-12-20 18:40:49 +00:00
parent 066c95dc07
commit 47788f56e0
1 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,10 @@ use std::borrow::Cow;
use handlebars::Handlebars; use handlebars::Handlebars;
use serde::Serialize; use serde::Serialize;
use tracing::instrument; use tracing::instrument;
use tokio::fs::{
DirEntry as FsDirEntry,
ReadDir as FsReadDir,
};
use super::{ use super::{
FileServerError, FileServerError,
@ -56,7 +60,7 @@ pub async fn serve_dir (
handlebars: &Handlebars <'static>, handlebars: &Handlebars <'static>,
instance_metrics: &metrics::Startup, instance_metrics: &metrics::Startup,
path: Cow <'_, str>, path: Cow <'_, str>,
mut dir: tokio::fs::ReadDir mut dir: FsReadDir
) -> Result <Response, FileServerError> ) -> Result <Response, FileServerError>
{ {
let mut entries = vec! []; let mut entries = vec! [];
@ -76,7 +80,7 @@ pub async fn serve_dir (
Ok (serve_html (s)) 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::{ use percent_encoding::{
CONTROLS, CONTROLS,