summaryrefslogtreecommitdiff
path: root/cli/flags.rs
diff options
context:
space:
mode:
authorMaxim <59533214+biryukovmaxim@users.noreply.github.com>2022-02-11 22:04:31 +0300
committerGitHub <noreply@github.com>2022-02-11 14:04:31 -0500
commit65de5fb4658e92f0730901b8b083af375050bd64 (patch)
treef1b410613c31fcc6095e394ce59c10b447d01cab /cli/flags.rs
parent2fa0096821cd04334210fcae6f54f85d304dc17a (diff)
refactor: use `Arc` instead of making copies of `Flags` struct (#13610)
Diffstat (limited to 'cli/flags.rs')
-rw-r--r--cli/flags.rs22
1 files changed, 10 insertions, 12 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index d4ba685fb..7255502fe 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -384,19 +384,17 @@ impl Flags {
vec![]
}
}
-}
-impl From<Flags> for PermissionsOptions {
- fn from(flags: Flags) -> Self {
- Self {
- allow_env: flags.allow_env,
- allow_hrtime: flags.allow_hrtime,
- allow_net: flags.allow_net,
- allow_ffi: flags.allow_ffi,
- allow_read: flags.allow_read,
- allow_run: flags.allow_run,
- allow_write: flags.allow_write,
- prompt: flags.prompt,
+ pub fn permissions_options(&self) -> PermissionsOptions {
+ PermissionsOptions {
+ allow_env: self.allow_env.clone(),
+ allow_hrtime: self.allow_hrtime,
+ allow_net: self.allow_net.clone(),
+ allow_ffi: self.allow_ffi.clone(),
+ allow_read: self.allow_read.clone(),
+ allow_run: self.allow_run.clone(),
+ allow_write: self.allow_write.clone(),
+ prompt: self.prompt,
}
}
}