Explain runtime invariants and avoid redundant unwraps
This commit is contained in:
1 parent
34f2f07301
commit
1b51ba83b4
116 files changed
+1643
-515
No files matched your search
@@ -157,17 +157,19 @@ impl Inhibit {
|
||||
let values = HashMap::from([
|
||||
(
|
||||
"screensaver-active".into(),
|
||||
Value::from(locked).try_into().unwrap(),
|
||||
Value::from(locked).try_into().expect("the D-Bus value uses an owned supported scalar or collection type"),
|
||||
),
|
||||
(
|
||||
"session-state".into(),
|
||||
Value::from(phase).try_into().unwrap(),
|
||||
Value::from(phase).try_into().expect("the D-Bus value uses an owned supported scalar or collection type"),
|
||||
),
|
||||
]);
|
||||
if let Ok(emitter) = SignalEmitter::new(&connection, PATH)
|
||||
&& Self::state_changed(
|
||||
&emitter,
|
||||
OwnedObjectPath::try_from(path.clone()).unwrap(),
|
||||
OwnedObjectPath::try_from(path.clone()).expect(
|
||||
"session handles were validated as D-Bus object paths",
|
||||
),
|
||||
values,
|
||||
)
|
||||
.await
|
||||
|
||||
Reference in new issue
Block a user