]> git.proxmox.com Git - proxmox-backup.git/commitdiff
rrd cache: code style, avoid useless intermediate mutable
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Feb 2022 06:53:29 +0000 (07:53 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Feb 2022 06:59:12 +0000 (07:59 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxmox-rrd/src/cache.rs

index edd46ed3ff710fe61ca8668bd24b342c8e2bfb07..ec90cd85c6bcbc4300363266a18798aedea20fd8 100644 (file)
@@ -101,24 +101,20 @@ impl RRDCache {
     ///
     /// The resultion data file size is about 80KB.
     pub fn create_proxmox_backup_default_rrd(dst: DST) -> RRD {
-
-        let mut rra_list = Vec::new();
-
-        // 1min * 1440 => 1day
-        rra_list.push(RRA::new(CF::Average, 60, 1440));
-        rra_list.push(RRA::new(CF::Maximum, 60, 1440));
-
-        // 30min * 1440 => 30days = 1month
-        rra_list.push(RRA::new(CF::Average, 30*60, 1440));
-        rra_list.push(RRA::new(CF::Maximum, 30*60, 1440));
-
-        // 6h * 1440 => 360days = 1year
-        rra_list.push(RRA::new(CF::Average, 6*3600, 1440));
-        rra_list.push(RRA::new(CF::Maximum, 6*3600, 1440));
-
-        // 1week * 570 => 10years
-        rra_list.push(RRA::new(CF::Average, 7*86400, 570));
-        rra_list.push(RRA::new(CF::Maximum, 7*86400, 570));
+        let rra_list = vec![
+            // 1 min * 1440 => 1 day
+            RRA::new(CF::Average, 60, 1440),
+            RRA::new(CF::Maximum, 60, 1440),
+            // 30 min * 1440 => 30 days ~ 1 month
+            RRA::new(CF::Average, 30 * 60, 1440),
+            RRA::new(CF::Maximum, 30 * 60, 1440),
+            // 6 h * 1440 => 360 days ~ 1 year
+            RRA::new(CF::Average, 6 * 3600, 1440),
+            RRA::new(CF::Maximum, 6 * 3600, 1440),
+            // 1 week * 570 => 10 years
+            RRA::new(CF::Average, 7 * 86400, 570),
+            RRA::new(CF::Maximum, 7 * 86400, 570),
+        ];
 
         RRD::new(dst, rra_list)
     }