Skip to content

Commit 8206fd0

Browse files
server: Fix plasma prompter always being executed
1 parent 062b9fb commit 8206fd0

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

server/src/plasma/prompter.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ pub enum CallbackAction {
2828
#[must_use]
2929
pub async fn in_plasma_environment(_connection: &zbus::Connection) -> bool {
3030
#[cfg(test)]
31-
return match env::var("OO7_DAEMON_PROMPTER_TEST").map(|v| v.to_lowercase() == "plasma") {
32-
Ok(_) => true,
33-
Err(_) => false,
34-
};
31+
return env::var("OO7_DAEMON_PROMPTER_TEST").is_ok_and(|v| v.to_lowercase() == "plasma");
3532

3633
#[cfg(not(test))]
3734
{
@@ -41,10 +38,9 @@ pub async fn in_plasma_environment(_connection: &zbus::Connection) -> bool {
4138
}
4239

4340
let is_plasma = async {
44-
match env::var("XDG_CURRENT_DESKTOP").map(|v| v.to_lowercase() == "kde") {
45-
Ok(_) => (),
46-
Err(_) => return false,
47-
};
41+
if !env::var("XDG_CURRENT_DESKTOP").is_ok_and(|v| v.to_lowercase() == "kde") {
42+
return false;
43+
}
4844

4945
let proxy = match zbus::fdo::DBusProxy::new(_connection).await {
5046
Ok(proxy) => proxy,

0 commit comments

Comments
 (0)