summaryrefslogtreecommitdiff
path: root/runtime/ops/fs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ops/fs.rs')
-rw-r--r--runtime/ops/fs.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs
index d965f768d..3d9802b08 100644
--- a/runtime/ops/fs.rs
+++ b/runtime/ops/fs.rs
@@ -1,6 +1,7 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
// Some deserializer fields are only used on Unix and Windows build fails without it
use super::io::StdFileResource;
+use super::utils::into_string;
use crate::fs_util::canonicalize_path;
use crate::permissions::Permissions;
use deno_core::error::bad_resource_id;
@@ -108,13 +109,6 @@ pub fn init(rt: &mut deno_core::JsRuntime) {
super::reg_json_async(rt, "op_utime_async", op_utime_async);
}
-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)]
#[serde(rename_all = "camelCase")]
pub struct OpenArgs {