diff options
author | 林炳权 <695601626@qq.com> | 2024-04-11 06:08:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-10 22:08:23 +0000 |
commit | 9304126be5633d4e7d384a8df87f5833a7a145e2 (patch) | |
tree | c074d89e9f2423c5121721ea94b9b4fb3101a482 /cli | |
parent | c6f1107e9c8835389479f4f2d80d3539d23df41e (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')
-rw-r--r-- | cli/npm/managed/cache.rs | 1 | ||||
-rw-r--r-- | cli/tools/vendor/build.rs | 11 | ||||
-rw-r--r-- | cli/tools/vendor/test.rs | 8 | ||||
-rw-r--r-- | cli/util/fs.rs | 5 | ||||
-rw-r--r-- | cli/worker.rs | 6 |
5 files changed, 5 insertions, 26 deletions
diff --git a/cli/npm/managed/cache.rs b/cli/npm/managed/cache.rs index 89587b430..9ba5c1c99 100644 --- a/cli/npm/managed/cache.rs +++ b/cli/npm/managed/cache.rs @@ -231,6 +231,7 @@ pub fn with_folder_sync_lock( match fs::OpenOptions::new() .write(true) .create(true) + .truncate(false) .open(&sync_lock_path) { Ok(_) => { 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>>; diff --git a/cli/tools/vendor/test.rs b/cli/tools/vendor/test.rs index c5e98c05e..d54bf5dc5 100644 --- a/cli/tools/vendor/test.rs +++ b/cli/tools/vendor/test.rs @@ -144,10 +144,6 @@ struct TestVendorEnvironment { } impl VendorEnvironment for TestVendorEnvironment { - fn cwd(&self) -> Result<PathBuf, AnyError> { - Ok(make_path("/")) - } - fn create_dir_all(&self, dir_path: &Path) -> Result<(), AnyError> { let mut directories = self.directories.borrow_mut(); for path in dir_path.ancestors() { @@ -169,10 +165,6 @@ impl VendorEnvironment for TestVendorEnvironment { ); Ok(()) } - - fn path_exists(&self, path: &Path) -> bool { - self.files.borrow().contains_key(&path.to_path_buf()) - } } pub struct VendorOutput { diff --git a/cli/util/fs.rs b/cli/util/fs.rs index ba55eb89d..92820ebe8 100644 --- a/cli/util/fs.rs +++ b/cli/util/fs.rs @@ -676,7 +676,9 @@ impl Drop for LaxSingleProcessFsFlagInner { /// This should only be used in places where it's ideal for multiple /// processes to not update something on the file system at the same time, /// but it's not that big of a deal. -pub struct LaxSingleProcessFsFlag(Option<LaxSingleProcessFsFlagInner>); +pub struct LaxSingleProcessFsFlag( + #[allow(dead_code)] Option<LaxSingleProcessFsFlagInner>, +); impl LaxSingleProcessFsFlag { pub async fn lock(file_path: PathBuf, long_wait_message: &str) -> Self { @@ -688,6 +690,7 @@ impl LaxSingleProcessFsFlag { .read(true) .write(true) .create(true) + .truncate(false) .open(&file_path); match open_result { diff --git a/cli/worker.rs b/cli/worker.rs index be5a85cd6..ed82f4872 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -72,12 +72,6 @@ pub trait ModuleLoaderFactory: Send + Sync { fn create_source_map_getter(&self) -> Option<Rc<dyn SourceMapGetter>>; } -// todo(dsherret): this is temporary and we should remove this -// once we no longer conditionally initialize the node runtime -pub trait HasNodeSpecifierChecker: Send + Sync { - fn has_node_specifier(&self) -> bool; -} - #[async_trait::async_trait(?Send)] pub trait HmrRunner: Send + Sync { async fn start(&mut self) -> Result<(), AnyError>; |