aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-10-16 19:13:16 +0200
committerIgor Pashev <pashev.igor@gmail.com>2019-10-16 19:13:16 +0200
commit7331909e7767509b27877d99adff1de44b41f8fb (patch)
treef80778d8bbe539d9670a4cb98426ebf69b03bec1 /src/main.rs
parent0f326725722743a4a003f1125c82f12787272bf8 (diff)
downloadfrotate.rs-7331909e7767509b27877d99adff1de44b41f8fb.tar.gz
Reverse date partitions later
Make partition_days() more like partition().
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 752204c..781018f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -7,6 +7,7 @@ use std::process::exit;
use chrono::NaiveDate;
use docopt::Docopt;
use serde::Deserialize;
+use std::collections::LinkedList;
mod lib;
use lib::partition_days;
@@ -40,7 +41,11 @@ fn main() {
.and_then(|d| d.deserialize())
.unwrap_or_else(|e| e.exit());
- let parts = partition_days(&|n| exponent(args.flag_base, n), &args.arg_day);
+ let parts: LinkedList<LinkedList<NaiveDate>> =
+ partition_days(&|n| exponent(args.flag_base, n), &args.arg_day)
+ .into_iter()
+ .map(|l| l.into_iter().rev().collect())
+ .collect();
if args.flag_keep {
for days in parts.iter() {