pretty: remove dead code

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain 2021-07-13 04:28:27 +05:30
parent c6262e9e87
commit 80c6809414
2 changed files with 2 additions and 8 deletions

View File

@ -1,7 +1,6 @@
use rocket_dyn_templates::Template;
use std::collections::HashMap;
use std::env;
use std::path::Path;
use crate::models::paste_id::PasteId;
@ -13,11 +12,9 @@ pub async fn pretty_retrieve(id: PasteId<'_>) -> Option<Template> {
let filepath = Path::new(&filename);
let contents = get_pretty_body(&filename, &String::from("txt"));
let theme = env::var("THEME").unwrap_or("".to_string());
let mut map = HashMap::new();
map.insert("title", id.to_string());
map.insert("theme", theme);
map.insert("body", contents);
let rendered = Template::render("pretty", &map);
@ -25,4 +22,4 @@ pub async fn pretty_retrieve(id: PasteId<'_>) -> Option<Template> {
true => Some(rendered),
false => None,
}
}
}

View File

@ -1,7 +1,6 @@
use rocket_dyn_templates::Template;
use std::collections::HashMap;
use std::env;
use std::path::Path;
use crate::models::pretty_syntax::PasteIdSyntax;
@ -16,11 +15,9 @@ pub async fn pretty_retrieve_ext(id_ext: PasteIdSyntax<'_>) -> Option<Template>
let filepath = Path::new(&filename);
let contents = get_pretty_body(&filename, &ext.to_string());
let theme = env::var("THEME").unwrap_or("".to_string());
let mut map = HashMap::new();
map.insert("title", id.to_string());
map.insert("theme", theme);
map.insert("body", contents);
let rendered = Template::render("pretty", &map);
@ -28,4 +25,4 @@ pub async fn pretty_retrieve_ext(id_ext: PasteIdSyntax<'_>) -> Option<Template>
true => Some(rendered),
false => None,
}
}
}