server: get index: make content-type non mutable

feels more idiomatic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-10-12 10:38:13 +02:00
parent 07995a3ca3
commit adfcfb6788
1 changed files with 3 additions and 6 deletions

View File

@ -368,13 +368,10 @@ fn get_index(
"debug": debug, "debug": debug,
}); });
let mut ct = "text/html"; let (ct, index) = match api.render_template(template_file, &data) {
Ok(index) => ("text/html", index),
let index = match api.render_template(template_file, &data) {
Ok(index) => index,
Err(err) => { Err(err) => {
ct = "text/plain"; ("text/plain", format!("Error rendering template: {}", err))
format!("Error rendering template: {}", err)
} }
}; };