summaryrefslogtreecommitdiff
path: root/runtime/ops/os.rs
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-04-06 10:33:43 +0200
committerGitHub <noreply@github.com>2021-04-06 10:33:43 +0200
commitff5d072702aee52882787ea85dd73573a8f8f316 (patch)
tree346d9ac446bbb307edaac0ce965b36dfe511305e /runtime/ops/os.rs
parent2c52c0a145337050fee03313a7c5698b761969dc (diff)
refactor: rewrite "net" ops to use serde_v8 (#10028)
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,