mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-21 10:30:48 +08:00
bin/patch: Fix default filter passed from CLI args
This commit is contained in:
+12
-2
@@ -111,13 +111,23 @@ impl ReviewOptions {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct ListFilter {
|
||||
state: Option<Status>,
|
||||
authored: bool,
|
||||
authors: Vec<Did>,
|
||||
}
|
||||
|
||||
impl Default for ListFilter {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
state: Some(Status::Open),
|
||||
authored: false,
|
||||
authors: vec![],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ListFilter {
|
||||
pub fn is_default(&self) -> bool {
|
||||
*self == ListFilter::default()
|
||||
@@ -146,7 +156,7 @@ impl Into<PatchFilter> for (Did, ListFilter) {
|
||||
let mut and = filter
|
||||
.state
|
||||
.map(|s| vec![PatchFilter::State(s)])
|
||||
.unwrap_or(vec![PatchFilter::State(Status::Open)]);
|
||||
.unwrap_or(vec![]);
|
||||
|
||||
let mut dids = filter.authored.then_some(vec![me]).unwrap_or_default();
|
||||
dids.append(&mut filter.authors);
|
||||
|
||||
Reference in New Issue
Block a user