pretty: remove dead code
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
parent
c6262e9e87
commit
80c6809414
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user