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 rocket_dyn_templates::Template;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use crate::models::paste_id::PasteId;
|
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 filepath = Path::new(&filename);
|
||||||
|
|
||||||
let contents = get_pretty_body(&filename, &String::from("txt"));
|
let contents = get_pretty_body(&filename, &String::from("txt"));
|
||||||
let theme = env::var("THEME").unwrap_or("".to_string());
|
|
||||||
|
|
||||||
let mut map = HashMap::new();
|
let mut map = HashMap::new();
|
||||||
map.insert("title", id.to_string());
|
map.insert("title", id.to_string());
|
||||||
map.insert("theme", theme);
|
|
||||||
map.insert("body", contents);
|
map.insert("body", contents);
|
||||||
let rendered = Template::render("pretty", &map);
|
let rendered = Template::render("pretty", &map);
|
||||||
|
|
||||||
|
@ -25,4 +22,4 @@ pub async fn pretty_retrieve(id: PasteId<'_>) -> Option<Template> {
|
||||||
true => Some(rendered),
|
true => Some(rendered),
|
||||||
false => None,
|
false => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use rocket_dyn_templates::Template;
|
use rocket_dyn_templates::Template;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use crate::models::pretty_syntax::PasteIdSyntax;
|
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 filepath = Path::new(&filename);
|
||||||
|
|
||||||
let contents = get_pretty_body(&filename, &ext.to_string());
|
let contents = get_pretty_body(&filename, &ext.to_string());
|
||||||
let theme = env::var("THEME").unwrap_or("".to_string());
|
|
||||||
|
|
||||||
let mut map = HashMap::new();
|
let mut map = HashMap::new();
|
||||||
map.insert("title", id.to_string());
|
map.insert("title", id.to_string());
|
||||||
map.insert("theme", theme);
|
|
||||||
map.insert("body", contents);
|
map.insert("body", contents);
|
||||||
let rendered = Template::render("pretty", &map);
|
let rendered = Template::render("pretty", &map);
|
||||||
|
|
||||||
|
@ -28,4 +25,4 @@ pub async fn pretty_retrieve_ext(id_ext: PasteIdSyntax<'_>) -> Option<Template>
|
||||||
true => Some(rendered),
|
true => Some(rendered),
|
||||||
false => None,
|
false => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user