diff options
author | Yiyu Lin <linyiyu1992@gmail.com> | 2023-01-15 12:06:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-15 09:36:46 +0530 |
commit | fd85f840cd707c31d08fa836562127e249c9ff62 (patch) | |
tree | c4847881976069d41d1b53616bdeaf5d073f3af6 /core | |
parent | 05ef925eb095ae603f694fe8172ddcbd5b19b9b2 (diff) |
refactor: clean up `unwrap` and `clone` (#17282)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/lib.rs | 5 | ||||
-rw-r--r-- | core/module_specifier.rs | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/lib.rs b/core/lib.rs index 308724fdd..2333ff75f 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -37,6 +37,8 @@ pub use sourcemap; pub use url; pub use v8; +pub use deno_ops::op; + pub use crate::async_cancel::CancelFuture; pub use crate::async_cancel::CancelHandle; pub use crate::async_cancel::CancelTryFuture; @@ -110,13 +112,12 @@ pub use crate::runtime::Snapshot; pub use crate::runtime::V8_WRAPPER_OBJECT_INDEX; pub use crate::runtime::V8_WRAPPER_TYPE_INDEX; pub use crate::source_map::SourceMapGetter; -pub use deno_ops::op; pub fn v8_version() -> &'static str { v8::V8::get_version() } -/// An internal module re-exporting funcs used by the #[op] (`deno_ops`) macro +/// An internal module re-exporting functions used by the #[op] (`deno_ops`) macro #[doc(hidden)] pub mod _ops { pub use super::bindings::throw_type_error; diff --git a/core/module_specifier.rs b/core/module_specifier.rs index 1d7abd1ca..832208758 100644 --- a/core/module_specifier.rs +++ b/core/module_specifier.rs @@ -142,7 +142,7 @@ pub fn resolve_path( .map_err(|_| ModuleResolutionError::InvalidPath(path_str.into()))? .join(path_str); let path = normalize_path(path); - Url::from_file_path(path.clone()) + Url::from_file_path(&path) .map_err(|()| ModuleResolutionError::InvalidPath(path)) } |