summaryrefslogtreecommitdiff
path: root/runtime/ops/os.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ops/os.rs')
-rw-r--r--runtime/ops/os.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/runtime/ops/os.rs b/runtime/ops/os.rs
index 3e6feacfe..5f265bf20 100644
--- a/runtime/ops/os.rs
+++ b/runtime/ops/os.rs
@@ -1,7 +1,8 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+use super::utils::into_string;
use crate::permissions::Permissions;
-use deno_core::error::{custom_error, type_error, AnyError};
+use deno_core::error::{type_error, AnyError};
use deno_core::url::Url;
use deno_core::OpState;
use deno_core::ZeroCopyBuf;
@@ -42,14 +43,6 @@ fn op_exec_path(
into_string(path.into_os_string())
}
-// TODO(@AaronO): share this code with fs' into_string()
-fn into_string(s: std::ffi::OsString) -> Result<String, AnyError> {
- s.into_string().map_err(|s| {
- let message = format!("File name or path {:?} is not valid UTF-8", s);
- custom_error("InvalidData", message)
- })
-}
-
#[derive(Deserialize)]
pub struct SetEnv {
key: String,