File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 1- use zbus:: { fdo, message:: Header , Connection } ;
1+ use std:: collections:: HashMap ;
2+ use zbus:: zvariant:: { OwnedValue , Value } ;
3+ use zbus:: { fdo, message:: Header , Connection , Proxy } ;
24
35pub async fn check_polkit ( hdr : Option < Header < ' _ > > , action_id : & str ) -> fdo:: Result < ( ) > {
6+ if !cfg ! ( feature = "polkit" ) {
7+ return Ok ( ( ) ) ;
8+ }
49 let connection = Connection :: system ( )
510 . await
611 . map_err ( |e| fdo:: Error :: Failed ( format ! ( "Failed to acquire dbus connection: {e}" ) ) ) ?;
712 check_polkit_with_connection ( hdr, action_id, connection) . await
813}
914
10- #[ cfg( feature = "polkit" ) ]
1115pub async fn check_polkit_with_connection (
1216 hdr : Option < Header < ' _ > > ,
1317 action_id : & str ,
@@ -87,12 +91,3 @@ pub async fn check_polkit_with_connection(
8791 ) ) )
8892 }
8993}
90-
91- #[ cfg( not( feature = "polkit" ) ) ]
92- pub async fn check_polkit_with_connection (
93- _hdr : Option < Header < ' _ > > ,
94- _action_id : & str ,
95- _connection : Connection ,
96- ) -> fdo:: Result < ( ) > {
97- Ok ( ( ) )
98- }
You can’t perform that action at this time.
0 commit comments