summaryrefslogtreecommitdiff
path: root/runtime/ops/utils.rs
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2024-10-22 01:41:08 -0700
committerGitHub <noreply@github.com>2024-10-22 01:41:08 -0700
commitf26c8bcf3167069ccd8ac3beb9185d1bf480a83f (patch)
tree6c83977b6d2e5b2cbfef9e8bde17188d5cc18347 /runtime/ops/utils.rs
parent67280f8b558902729c805fd3d8f26d4c434fc211 (diff)
refactor(runtime/ops): use concrete error types (#26409)
Diffstat (limited to 'runtime/ops/utils.rs')
-rw-r--r--runtime/ops/utils.rs12
1 files changed, 0 insertions, 12 deletions
diff --git a/runtime/ops/utils.rs b/runtime/ops/utils.rs
deleted file mode 100644
index d5ce61c1f..000000000
--- a/runtime/ops/utils.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-
-use deno_core::error::custom_error;
-use deno_core::error::AnyError;
-
-/// A utility function to map OsStrings to Strings
-pub fn into_string(s: std::ffi::OsString) -> Result<String, AnyError> {
- s.into_string().map_err(|s| {
- let message = format!("File name or path {s:?} is not valid UTF-8");
- custom_error("InvalidData", message)
- })
-}