aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
authorGaurav <allmanpride@gmail.com>2022-08-04 00:03:37 +0000
committerGaurav <allmanpride@gmail.com>2022-08-14 00:03:55 +0000
commitf56840a4c04b18fcc6955d7105d32ec9bd6b01dd (patch)
treef804a529d7f8bc36ea49e03496149f767158899c /src/renderer.rs
parentReplace `markdown` by `comrak`; Render support for nested dirs (diff)
downloadminiserve-f56840a4c04b18fcc6955d7105d32ec9bd6b01dd.tar.gz
miniserve-f56840a4c04b18fcc6955d7105d32ec9bd6b01dd.zip
Satisfy cargo fmt
Diffstat (limited to '')
-rw-r--r--src/renderer.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index 5fdd2be..3ce985b 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -2,11 +2,11 @@ use actix_web::http::StatusCode;
use chrono::{DateTime, Utc};
use chrono_humanize::Humanize;
use clap::{crate_name, crate_version};
+use comrak::{markdown_to_html, ComrakOptions};
use maud::{html, Markup, PreEscaped, DOCTYPE};
use std::path::PathBuf;
use std::time::SystemTime;
use strum::IntoEnumIterator;
-use comrak::{markdown_to_html, ComrakOptions};
use crate::auth::CurrentUser;
use crate::listing::{Breadcrumb, Entry, QueryParameters, SortingMethod, SortingOrder};
@@ -168,17 +168,17 @@ pub fn page(
}
}
}
- @if readme.is_some() {
- div {
- h3 { (readme.as_ref().unwrap().file_name().unwrap()
- .to_string_lossy().to_string()) }
- (PreEscaped
- (markdown_to_html(
- &std::fs::read_to_string(readme.unwrap())
- .unwrap_or_else(|_| "Cannot read File.".to_string()),
- &ComrakOptions::default())));
- }
- }
+ @if readme.is_some() {
+ div {
+ h3 { (readme.as_ref().unwrap().file_name().unwrap()
+ .to_string_lossy().to_string()) }
+ (PreEscaped
+ (markdown_to_html(
+ &std::fs::read_to_string(readme.unwrap())
+ .unwrap_or_else(|_| "Cannot read File.".to_string()),
+ &ComrakOptions::default())));
+ }
+ }
a.back href="#top" {
(arrow_up())
}