@@ -910,20 +910,20 @@ pub enum PermissionState {
910910 Granted ,
911911 /// Permission access has been denied.
912912 Denied ,
913+ /// Permission must be requested.
914+ #[ default]
915+ Prompt ,
913916 /// Permission must be requested, but you must explain to the user why your app needs that permission. **Android only**.
914917 PromptWithRationale ,
915- /// Unknown state. Must request permission.
916- #[ default]
917- Unknown ,
918918}
919919
920920impl std:: fmt:: Display for PermissionState {
921921 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
922922 match self {
923923 Self :: Granted => write ! ( f, "granted" ) ,
924924 Self :: Denied => write ! ( f, "denied" ) ,
925+ Self :: Prompt => write ! ( f, "prompt" ) ,
925926 Self :: PromptWithRationale => write ! ( f, "prompt-with-rationale" ) ,
926- Self :: Unknown => write ! ( f, "Unknown" ) ,
927927 }
928928 }
929929}
@@ -946,8 +946,8 @@ impl<'de> Deserialize<'de> for PermissionState {
946946 match s. to_lowercase ( ) . as_str ( ) {
947947 "granted" => Ok ( Self :: Granted ) ,
948948 "denied" => Ok ( Self :: Denied ) ,
949+ "prompt" => Ok ( Self :: Prompt ) ,
949950 "prompt-with-rationale" => Ok ( Self :: PromptWithRationale ) ,
950- "prompt" => Ok ( Self :: Unknown ) ,
951951 _ => Err ( DeError :: custom ( format ! ( "unknown permission state '{s}'" ) ) ) ,
952952 }
953953 }
0 commit comments