Skip to content

Commit

Permalink
Construct age check result at end of gc_find
Browse files Browse the repository at this point in the history
  • Loading branch information
wezm committed Oct 1, 2021
1 parent 9c8e655 commit a1e14a1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main.rs
Expand Up @@ -284,19 +284,17 @@ fn gc_find() -> Result<AgeCheckResult> {
group.push(snapshot.clone());
}
}
let mut aggregate = AgeCheckResult {
keep: vec![],
delete: vec![],
};
let mut keep = vec![];
let mut delete = vec![];
for (key, group) in &by_dataset {
let check = check_age(
group.to_vec(),
RetentionPolicy::from_str(&ZFS::get_property(key, PROPERTY_SNAPKEEP)?).unwrap(),
);
aggregate.keep.extend_from_slice(&check.keep);
aggregate.delete.extend_from_slice(&check.delete);
keep.extend(check.keep);
delete.extend(check.delete);
}
Ok(aggregate)
Ok(AgeCheckResult { keep, delete })
}

fn do_help() {
Expand Down

0 comments on commit a1e14a1

Please sign in to comment.