refactor reviewsperbackend

This commit is contained in:
Dr. Matthias Ratajczak
2023-02-02 14:53:17 +01:00
parent 52aa2696a5
commit fcbb33390a
2 changed files with 12 additions and 2 deletions
+11 -1
View File
@@ -23,7 +23,7 @@ pub(super) enum ReviewIntention {
#[derive(Debug)]
pub(super) struct ReviewsPerBackend {
pub items: Vec<(Box<dyn Backend>, Vec<ReviewAction>)>,
items: Vec<(Box<dyn Backend>, Vec<ReviewAction>)>,
}
impl ReviewsPerBackend {
@@ -40,6 +40,16 @@ impl ReviewsPerBackend {
}
}
impl IntoIterator for ReviewsPerBackend {
type Item = (Box<dyn Backend>, Vec<ReviewAction>);
type IntoIter = std::vec::IntoIter<(Box<dyn Backend>, Vec<ReviewAction>)>;
fn into_iter(self) -> Self::IntoIter {
self.items.into_iter()
}
}
pub(super) enum ContinueWithReview {
Yes,
No,
+1 -1
View File
@@ -84,7 +84,7 @@ impl From<ReviewsPerBackend> for Vec<Strategy> {
fn from(reviews: ReviewsPerBackend) -> Self {
let mut result = vec![];
for (backend, actions) in reviews.items {
for (backend, actions) in reviews {
let (to_delete, assign_group, as_dependency) = divide_actions(actions);
result.push(Strategy::new(