File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,10 +28,7 @@ pub enum CallbackAction {
2828#[ must_use]
2929pub 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,
You can’t perform that action at this time.
0 commit comments