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:
parent
07995a3ca3
commit
adfcfb6788
|
@ -368,13 +368,10 @@ fn get_index(
|
|||
"debug": debug,
|
||||
});
|
||||
|
||||
let mut ct = "text/html";
|
||||
|
||||
let index = match api.render_template(template_file, &data) {
|
||||
Ok(index) => index,
|
||||
let (ct, index) = match api.render_template(template_file, &data) {
|
||||
Ok(index) => ("text/html", index),
|
||||
Err(err) => {
|
||||
ct = "text/plain";
|
||||
format!("Error rendering template: {}", err)
|
||||
("text/plain", format!("Error rendering template: {}", err))
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue