From de8ae91f3c6219f8a6c9aa24abfad9dc0574c8cf Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Mon, 22 Dec 2025 01:19:47 +0100 Subject: [PATCH] bin/patch: Fix default filter passed from CLI args --- bin/commands/patch.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/commands/patch.rs b/bin/commands/patch.rs index 70ce42cc..95567fb0 100644 --- a/bin/commands/patch.rs +++ b/bin/commands/patch.rs @@ -111,13 +111,23 @@ impl ReviewOptions { } } -#[derive(Clone, Default, Debug, Eq, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct ListFilter { state: Option, authored: bool, authors: Vec, } +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 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);