]> git.proxmox.com Git - proxmox-backup.git/commitdiff
server: get index: make content-type non mutable
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Oct 2020 08:38:13 +0000 (10:38 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Oct 2020 11:36:45 +0000 (13:36 +0200)
feels more idiomatic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/server/rest.rs

index 00a7f5303e63d2eab40b8ea251ced4bb4d203f82..912327f04b36f436cf71bcd3259f127c52f8d275 100644 (file)
@@ -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))
         }
     };