1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-09 07:39:15 -05:00

remove extra dot in Permission request output (#4471)

This commit is contained in:
Kevin (Kun) "Kassimo" Qian 2020-03-23 21:54:17 -07:00 committed by GitHub
parent 70a5034431
commit c61a231ff4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -217,7 +217,7 @@ impl DenoPermissions {
pub fn request_run(&mut self) -> PermissionState { pub fn request_run(&mut self) -> PermissionState {
self self
.allow_run .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 { pub fn request_read(&mut self, path: &Option<&Path>) -> PermissionState {
@ -225,9 +225,9 @@ impl DenoPermissions {
return PermissionState::Allow; return PermissionState::Allow;
}; };
self.allow_read.request(&match path { self.allow_read.request(&match path {
None => "Deno requests read access.".to_string(), None => "Deno requests read access".to_string(),
Some(path) => { Some(path) => {
format!("Deno requests read access to \"{}\".", path.display()) format!("Deno requests read access to \"{}\"", path.display())
} }
}) })
} }
@ -237,9 +237,9 @@ impl DenoPermissions {
return PermissionState::Allow; return PermissionState::Allow;
}; };
self.allow_write.request(&match path { self.allow_write.request(&match path {
None => "Deno requests write access.".to_string(), None => "Deno requests write access".to_string(),
Some(path) => { Some(path) => {
format!("Deno requests write access to \"{}\".", path.display()) format!("Deno requests write access to \"{}\"", path.display())
} }
}) })
} }
@ -250,8 +250,8 @@ impl DenoPermissions {
) -> Result<PermissionState, OpError> { ) -> Result<PermissionState, OpError> {
if self.get_state_net_url(url)? == PermissionState::Ask { if self.get_state_net_url(url)? == PermissionState::Ask {
return Ok(self.allow_net.request(&match url { return Ok(self.allow_net.request(&match url {
None => "Deno requests network access.".to_string(), None => "Deno requests network access".to_string(),
Some(url) => format!("Deno requests network access to \"{}\".", url), Some(url) => format!("Deno requests network access to \"{}\"", url),
})); }));
}; };
self.get_state_net_url(url) self.get_state_net_url(url)
@ -260,17 +260,17 @@ impl DenoPermissions {
pub fn request_env(&mut self) -> PermissionState { pub fn request_env(&mut self) -> PermissionState {
self self
.allow_env .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 { pub fn request_hrtime(&mut self) -> PermissionState {
self self
.allow_hrtime .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 { 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( pub fn get_permission_state(