Skip to content

Commit

Permalink
remove extra dot in Permission request output (denoland#4471)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkassimo committed Mar 24, 2020
1 parent 70a5034 commit c61a231
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cli/permissions.rs
Expand Up @@ -217,17 +217,17 @@ impl DenoPermissions {
pub fn request_run(&mut self) -> PermissionState {
self
.allow_run
.request("Deno requests to access to run a subprocess.")
.request("Deno requests to access to run a subprocess")
}

pub fn request_read(&mut self, path: &Option<&Path>) -> PermissionState {
if path.map_or(false, |f| check_path_white_list(f, &self.read_whitelist)) {
return PermissionState::Allow;
};
self.allow_read.request(&match path {
None => "Deno requests read access.".to_string(),
None => "Deno requests read access".to_string(),
Some(path) => {
format!("Deno requests read access to \"{}\".", path.display())
format!("Deno requests read access to \"{}\"", path.display())
}
})
}
Expand All @@ -237,9 +237,9 @@ impl DenoPermissions {
return PermissionState::Allow;
};
self.allow_write.request(&match path {
None => "Deno requests write access.".to_string(),
None => "Deno requests write access".to_string(),
Some(path) => {
format!("Deno requests write access to \"{}\".", path.display())
format!("Deno requests write access to \"{}\"", path.display())
}
})
}
Expand All @@ -250,8 +250,8 @@ impl DenoPermissions {
) -> Result<PermissionState, OpError> {
if self.get_state_net_url(url)? == PermissionState::Ask {
return Ok(self.allow_net.request(&match url {
None => "Deno requests network access.".to_string(),
Some(url) => format!("Deno requests network access to \"{}\".", url),
None => "Deno requests network access".to_string(),
Some(url) => format!("Deno requests network access to \"{}\"", url),
}));
};
self.get_state_net_url(url)
Expand All @@ -260,17 +260,17 @@ impl DenoPermissions {
pub fn request_env(&mut self) -> PermissionState {
self
.allow_env
.request("Deno requests to access to environment variables.")
.request("Deno requests to access to environment variables")
}

pub fn request_hrtime(&mut self) -> PermissionState {
self
.allow_hrtime
.request("Deno requests to access to high precision time.")
.request("Deno requests to access to high precision time")
}

pub fn request_plugin(&mut self) -> PermissionState {
self.allow_plugin.request("Deno requests to open plugins.")
self.allow_plugin.request("Deno requests to open plugins")
}

pub fn get_permission_state(
Expand Down

0 comments on commit c61a231

Please sign in to comment.