diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2021-06-07 22:29:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-07 22:29:47 -0400 |
commit | 6ee983b12741d2c38b7d2babb88f5ace317dc4b4 (patch) | |
tree | b5f7fecc0241bc9dfe24c693ad7284251954e5b0 /runtime/permissions.rs | |
parent | 8e96961f0e0c91a6acf73a35e03dda826108e152 (diff) |
chore(tools): Fix stdout buffer of launched process getting full causing tools/lint.js to hang on Windows (#10888)
Also fix Windows only clippy issues.
Diffstat (limited to 'runtime/permissions.rs')
-rw-r--r-- | runtime/permissions.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/permissions.rs b/runtime/permissions.rs index d98bcc71a..f8385e201 100644 --- a/runtime/permissions.rs +++ b/runtime/permissions.rs @@ -605,17 +605,20 @@ impl UnaryPermission<EnvDescriptor> { pub fn request(&mut self, env: Option<&str>) -> PermissionState { if let Some(env) = env { - #[cfg(windows)] - let env = env.to_uppercase(); + let env = if cfg!(windows) { + env.to_uppercase() + } else { + env.to_string() + }; let state = self.query(Some(&env)); if state == PermissionState::Prompt { if permission_prompt(&format!("env access to \"{}\"", env)) { self.granted_list.retain(|env_| env_.0 != env); - self.granted_list.insert(EnvDescriptor(env.to_string())); + self.granted_list.insert(EnvDescriptor(env)); PermissionState::Granted } else { self.denied_list.retain(|env_| env_.0 != env); - self.denied_list.insert(EnvDescriptor(env.to_string())); + self.denied_list.insert(EnvDescriptor(env)); self.global_state = PermissionState::Denied; PermissionState::Denied } |