@@ -19,7 +19,6 @@ macro_rules! check {
1919 } } ;
2020}
2121
22-
2322#[ derive( Debug , Clone , Copy , serde:: Serialize , serde:: Deserialize , specta:: Type ) ]
2423#[ serde( rename_all = "camelCase" ) ]
2524pub enum Permission {
@@ -117,7 +116,9 @@ impl<'a, R: tauri::Runtime, M: tauri::Manager<R>> Permissions<'a, R, M> {
117116 #[ cfg( target_os = "macos" ) ]
118117 {
119118 std:: process:: Command :: new ( "open" )
120- . arg ( "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture" )
119+ . arg (
120+ "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture" ,
121+ )
121122 . spawn ( ) ?
122123 . wait ( ) ?;
123124 }
@@ -129,7 +130,9 @@ impl<'a, R: tauri::Runtime, M: tauri::Manager<R>> Permissions<'a, R, M> {
129130 #[ cfg( target_os = "macos" ) ]
130131 {
131132 std:: process:: Command :: new ( "open" )
132- . arg ( "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility" )
133+ . arg (
134+ "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility" ,
135+ )
133136 . spawn ( ) ?
134137 . wait ( ) ?;
135138 }
@@ -139,10 +142,9 @@ impl<'a, R: tauri::Runtime, M: tauri::Manager<R>> Permissions<'a, R, M> {
139142
140143 async fn check_calendar ( & self ) -> Result < PermissionStatus , crate :: Error > {
141144 #[ cfg( target_os = "macos" ) ]
142- return check ! (
143- "calendar" ,
144- unsafe { EKEventStore :: authorizationStatusForEntityType( EKEntityType :: Event ) }
145- ) ;
145+ return check ! ( "calendar" , unsafe {
146+ EKEventStore :: authorizationStatusForEntityType( EKEntityType :: Event )
147+ } ) ;
146148
147149 #[ cfg( not( target_os = "macos" ) ) ]
148150 {
@@ -152,10 +154,9 @@ impl<'a, R: tauri::Runtime, M: tauri::Manager<R>> Permissions<'a, R, M> {
152154
153155 async fn check_contacts ( & self ) -> Result < PermissionStatus , crate :: Error > {
154156 #[ cfg( target_os = "macos" ) ]
155- return check ! (
156- "contacts" ,
157- unsafe { CNContactStore :: authorizationStatusForEntityType( CNEntityType :: Contacts ) }
158- ) ;
157+ return check ! ( "contacts" , unsafe {
158+ CNContactStore :: authorizationStatusForEntityType( CNEntityType :: Contacts )
159+ } ) ;
159160
160161 #[ cfg( not( target_os = "macos" ) ) ]
161162 {
@@ -202,7 +203,10 @@ impl<'a, R: tauri::Runtime, M: tauri::Manager<R>> Permissions<'a, R, M> {
202203
203204 async fn check_accessibility ( & self ) -> Result < PermissionStatus , crate :: Error > {
204205 #[ cfg( target_os = "macos" ) ]
205- return check ! ( "accessibility" , macos_accessibility_client:: accessibility:: application_is_trusted( ) ) ;
206+ return check ! (
207+ "accessibility" ,
208+ macos_accessibility_client:: accessibility:: application_is_trusted( )
209+ ) ;
206210
207211 #[ cfg( not( target_os = "macos" ) ) ]
208212 {
@@ -379,4 +383,3 @@ impl<R: tauri::Runtime, T: tauri::Manager<R>> PermissionsPluginExt<R> for T {
379383 }
380384 }
381385}
382-
0 commit comments