From e4bf1f0362d1cce71bbfa571ea3c37d1aa6017ce Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sat, 14 Mar 2020 19:18:54 +0200 Subject: Apply suggestions by clippy --- src/partition.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/partition.rs') diff --git a/src/partition.rs b/src/partition.rs index 8197112..46efeac 100644 --- a/src/partition.rs +++ b/src/partition.rs @@ -132,7 +132,7 @@ mod tests { } } -pub fn partition(f: &dyn Fn(u32) -> i64, v: &Vec) -> LinkedList> { +pub fn partition(f: &dyn Fn(u32) -> i64, v: &[i64]) -> LinkedList> { let mut term: LinkedList = LinkedList::new(); let mut res: LinkedList> = LinkedList::new(); let mut n: u32 = 1; @@ -154,7 +154,7 @@ pub fn partition(f: &dyn Fn(u32) -> i64, v: &Vec) -> LinkedList i64, - days: &Vec, + days: &[NaiveDate], ) -> LinkedList> { let day1 = days[0]; let part; @@ -171,10 +171,7 @@ pub fn partition_days( part = partition(f, &v); } - let res = part - .into_iter() + part.into_iter() .map(|l| l.into_iter().map(|d| day1 - Duration::days(d)).collect()) - .collect(); - - res + .collect() } -- cgit v1.2.3