summaryrefslogtreecommitdiff
path: root/runtime/ops/fs.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/fs.rs
parent2c52c0a145337050fee03313a7c5698b761969dc (diff)
refactor: rewrite "net" ops to use serde_v8 (#10028)
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 {