Files
zesdex/apps/infrastructure/src/review/pending.rs
T

44 lines
949 B
Rust
Raw Normal View History

//! Pending review queue — tracks files modified by tools that have not
//! yet been reviewed.
use std::collections::VecDeque;
/// A file mutation awaiting review.
#[derive(Debug, Clone)]
pub struct PendingReview {
pub path: String,
pub tool: String,
pub reason: String,
pub content_sha256: String,
}
/// Queue of files modified but not yet reviewed.
#[derive(Debug, Clone, Default)]
pub struct PendingReviewQueue {
entries: VecDeque<PendingReview>,
}
impl PendingReviewQueue {
pub fn new() -> Self {
PendingReviewQueue {
entries: VecDeque::new(),
}
}
pub fn push(&mut self, entry: PendingReview) {
self.entries.push_back(entry);
}
pub fn pop(&mut self) -> Option<PendingReview> {
self.entries.pop_front()
}
pub fn is_empty(&self) -> bool {
self.entries.is_empty()
}
pub fn len(&self) -> usize {
self.entries.len()
}
}