summaryrefslogtreecommitdiff
path: root/runtime/permissions/mod.rs
diff options
context:
space:
mode:
authorYiyu Lin <linyiyu1992@gmail.com>2023-01-15 12:06:46 +0800
committerGitHub <noreply@github.com>2023-01-15 09:36:46 +0530
commitfd85f840cd707c31d08fa836562127e249c9ff62 (patch)
treec4847881976069d41d1b53616bdeaf5d073f3af6 /runtime/permissions/mod.rs
parent05ef925eb095ae603f694fe8172ddcbd5b19b9b2 (diff)
refactor: clean up `unwrap` and `clone` (#17282)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'runtime/permissions/mod.rs')
-rw-r--r--runtime/permissions/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs
index 024aa81d9..5424a3f36 100644
--- a/runtime/permissions/mod.rs
+++ b/runtime/permissions/mod.rs
@@ -427,7 +427,7 @@ impl UnaryPermission<ReadDescriptor> {
self.prompt,
);
if prompted {
- let resolved_path = resolve_from_cwd(path).unwrap();
+ let resolved_path = resolve_from_cwd(path)?;
if result.is_ok() {
self.granted_list.insert(ReadDescriptor(resolved_path));
} else {
@@ -446,7 +446,7 @@ impl UnaryPermission<ReadDescriptor> {
display: &str,
api_name: &str,
) -> Result<(), AnyError> {
- let resolved_path = resolve_from_cwd(path).unwrap();
+ let resolved_path = resolve_from_cwd(path)?;
let (result, prompted) = self.query(Some(&resolved_path)).check(
self.name,
Some(api_name),
@@ -600,7 +600,7 @@ impl UnaryPermission<WriteDescriptor> {
self.prompt,
);
if prompted {
- let resolved_path = resolve_from_cwd(path).unwrap();
+ let resolved_path = resolve_from_cwd(path)?;
if result.is_ok() {
self.granted_list.insert(WriteDescriptor(resolved_path));
} else {