diff options
author | Colin Ihrig <cjihrig@gmail.com> | 2022-10-26 16:37:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 16:37:48 -0400 |
commit | 37340e23865b17b1466a7e32997b0add96dd3806 (patch) | |
tree | 4e72b47e33d2cff14a8b62231a9fa0555e8492a0 /runtime/ops/os.rs | |
parent | f4f1f4f0b64030b744cfb43693af321ea8332bf4 (diff) |
chore(unstable): rename Deno.getUid() and Deno.getGid() (#16432)
This commit renames `Deno.getUid()` to `Deno.uid()` and renames
`Deno.getGid()` to `Deno.gid()`.
Diffstat (limited to 'runtime/ops/os.rs')
-rw-r--r-- | runtime/ops/os.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/runtime/ops/os.rs b/runtime/ops/os.rs index 2aafdc7a3..35b49217c 100644 --- a/runtime/ops/os.rs +++ b/runtime/ops/os.rs @@ -20,8 +20,7 @@ fn init_ops(builder: &mut ExtensionBuilder) -> &mut ExtensionBuilder { op_exit::decl(), op_delete_env::decl(), op_get_env::decl(), - op_getgid::decl(), - op_getuid::decl(), + op_gid::decl(), op_hostname::decl(), op_loadavg::decl(), op_network_interfaces::decl(), @@ -29,6 +28,7 @@ fn init_ops(builder: &mut ExtensionBuilder) -> &mut ExtensionBuilder { op_set_env::decl(), op_set_exit_code::decl(), op_system_memory_info::decl(), + op_uid::decl(), ]) } @@ -284,12 +284,12 @@ fn op_system_memory_info( #[cfg(not(windows))] #[op] -fn op_getgid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getGid"); +fn op_gid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.gid"); state .borrow_mut::<Permissions>() .sys - .check("getGid", Some("Deno.getGid()"))?; + .check("gid", Some("Deno.gid()"))?; // TODO(bartlomieju): #[allow(clippy::undocumented_unsafe_blocks)] unsafe { @@ -299,23 +299,23 @@ fn op_getgid(state: &mut OpState) -> Result<Option<u32>, AnyError> { #[cfg(windows)] #[op] -fn op_getgid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getGid"); +fn op_gid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.gid"); state .borrow_mut::<Permissions>() .sys - .check("getGid", Some("Deno.getGid()"))?; + .check("gid", Some("Deno.gid()"))?; Ok(None) } #[cfg(not(windows))] #[op] -fn op_getuid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getUid"); +fn op_uid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.uid"); state .borrow_mut::<Permissions>() .sys - .check("getUid", Some("Deno.getUid()"))?; + .check("uid", Some("Deno.uid()"))?; // TODO(bartlomieju): #[allow(clippy::undocumented_unsafe_blocks)] unsafe { @@ -325,11 +325,11 @@ fn op_getuid(state: &mut OpState) -> Result<Option<u32>, AnyError> { #[cfg(windows)] #[op] -fn op_getuid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getUid"); +fn op_uid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.uid"); state .borrow_mut::<Permissions>() .sys - .check("getUid", Some("Deno.getUid()"))?; + .check("uid", Some("Deno.uid()"))?; Ok(None) } |