summaryrefslogtreecommitdiff
path: root/cli/tools/vendor/build.rs
diff options
context:
space:
mode:
author林炳权 <695601626@qq.com>2024-04-11 06:08:23 +0800
committerGitHub <noreply@github.com>2024-04-10 22:08:23 +0000
commit9304126be5633d4e7d384a8df87f5833a7a145e2 (patch)
treec074d89e9f2423c5121721ea94b9b4fb3101a482 /cli/tools/vendor/build.rs
parentc6f1107e9c8835389479f4f2d80d3539d23df41e (diff)
chore: update to Rust 1.77.2 (#23262)
update to Rust 1.77.2 --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'cli/tools/vendor/build.rs')
-rw-r--r--cli/tools/vendor/build.rs11
1 files changed, 0 insertions, 11 deletions
diff --git a/cli/tools/vendor/build.rs b/cli/tools/vendor/build.rs
index 1646a9959..0590992b0 100644
--- a/cli/tools/vendor/build.rs
+++ b/cli/tools/vendor/build.rs
@@ -2,7 +2,6 @@
use std::fmt::Write as _;
use std::path::Path;
-use std::path::PathBuf;
use std::sync::Arc;
use deno_ast::ModuleSpecifier;
@@ -34,19 +33,13 @@ use super::specifiers::is_remote_specifier;
/// Allows substituting the environment for testing purposes.
pub trait VendorEnvironment {
- fn cwd(&self) -> Result<PathBuf, AnyError>;
fn create_dir_all(&self, dir_path: &Path) -> Result<(), AnyError>;
fn write_file(&self, file_path: &Path, bytes: &[u8]) -> Result<(), AnyError>;
- fn path_exists(&self, path: &Path) -> bool;
}
pub struct RealVendorEnvironment;
impl VendorEnvironment for RealVendorEnvironment {
- fn cwd(&self) -> Result<PathBuf, AnyError> {
- Ok(std::env::current_dir()?)
- }
-
fn create_dir_all(&self, dir_path: &Path) -> Result<(), AnyError> {
Ok(std::fs::create_dir_all(dir_path)?)
}
@@ -55,10 +48,6 @@ impl VendorEnvironment for RealVendorEnvironment {
std::fs::write(file_path, bytes)
.with_context(|| format!("Failed writing {}", file_path.display()))
}
-
- fn path_exists(&self, path: &Path) -> bool {
- path.exists()
- }
}
type BuildGraphFuture = LocalBoxFuture<'static, Result<ModuleGraph, AnyError>>;