removed a single use variable

pull/1/head
kirbylife 2019-11-25 17:42:57 -06:00
parent 11e183504d
commit b7bca3e455
1 changed files with 5 additions and 7 deletions

View File

@ -87,14 +87,12 @@ fn show_post(title: String) -> Template {
let title_splited: Vec<&str> = title.split('-').collect();
let id = title_splited.last().unwrap().parse().unwrap();
let post = get_post(id);
match get_post(id) {
Ok(mut post) => {
let content = markdown_to_html(&post.content, &ComrakOptions::default());
post.content = content;
match post {
Ok(mut p) => {
let content = markdown_to_html(&p.content, &ComrakOptions::default());
p.content = content;
context.insert("post", &p);
context.insert("post", &post);
Template::render("post", context)
}
Err(_e) => {