Skip to content

Commit

Permalink
Fix scope bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rgwood committed Feb 29, 2024
1 parent 72bc220 commit 8c03528
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct App {

impl App {
pub fn new(scope: Scope) -> Result<Self> {
let home = Home::new();
let home = Home::new(scope);
let home = Arc::new(Mutex::new(home));
Ok(Self { scope, home, should_quit: false, should_suspend: false })
}
Expand Down
6 changes: 4 additions & 2 deletions src/components/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ impl<T> StatefulList<T> {
}

impl Home {
pub fn new() -> Self {
Self::default()
pub fn new(scope: Scope) -> Self {
let mut ret = Self::default();
ret.scope = scope;
ret
}

pub fn set_units(&mut self, units: Vec<UnitWithStatus>) {
Expand Down
2 changes: 1 addition & 1 deletion src/systemd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn to_unit_status(raw_unit: RawUnit, scope: UnitScope) -> UnitWithStatus {
}

// Different from UnitScope in that this is not for 1 specific unit (i.e. it can include multiple scopes)
#[derive(Clone, Default)]
#[derive(Clone, Copy, Default, Debug)]
pub enum Scope {
Global,
User,
Expand Down

0 comments on commit 8c03528

Please sign in to comment.