From f56840a4c04b18fcc6955d7105d32ec9bd6b01dd Mon Sep 17 00:00:00 2001 From: Gaurav Date: Wed, 3 Aug 2022 20:03:37 -0400 Subject: Satisfy cargo fmt --- src/listing.rs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/listing.rs') diff --git a/src/listing.rs b/src/listing.rs index 436add9..42054ca 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -283,14 +283,22 @@ pub fn directory_listing( last_modification_date, symlink_dest, )); - // TODO: Pattern match? - if conf.readme && file_name.to_lowercase() == "readme.md"{ - let file_path = conf.path.canonicalize().unwrap() - .join(base.as_os_str().to_str().unwrap() - .strip_prefix("/").unwrap()) - .join(&file_name); - readme = Some(file_path); - } + // TODO: Pattern match? + if conf.readme && file_name.to_lowercase() == "readme.md" { + let file_path = conf + .path + .canonicalize() + .unwrap() + .join( + base.as_os_str() + .to_str() + .unwrap() + .strip_prefix('/') + .unwrap(), + ) + .join(&file_name); + readme = Some(file_path); + } } } else { continue; @@ -381,7 +389,7 @@ pub fn directory_listing( HttpResponse::Ok().content_type(mime::TEXT_HTML_UTF_8).body( renderer::page( entries, - readme, + readme, is_root, query_params, breadcrumbs, -- cgit v1.2.3