Skip to content

Commit 714bfef

Browse files
committed
Revert to libstd's remove_dir_all instead of external crate.
This avoids the Windows dependencies. The bug that caused us to switch to the crate in the first place was addressed in Rust 1.66+ (rust-lang/rust#104558)
1 parent 074f152 commit 714bfef

File tree

5 files changed

+17
-145
lines changed

5 files changed

+17
-145
lines changed

Cargo.lock

+14-141
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glean-core/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ crossbeam-channel = "0.5"
4242
thiserror = "1.0.4"
4343
uniffi = { version = "0.23.0", default-features = false }
4444
time = "0.1.40"
45-
remove_dir_all = "0.8.1"
4645
env_logger = { version = "0.10.0", default-features = false, optional = true }
4746

4847
[target.'cfg(target_os = "android")'.dependencies]

glean-core/src/event_database/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ impl EventDatabase {
584584

585585
// safe unwrap, only error case is poisoning
586586
let _lock = self.file_lock.write().unwrap();
587-
remove_dir_all::remove_dir_all(&self.path)?;
587+
std::fs::remove_dir_all(&self.path)?;
588588
create_dir_all(&self.path)?;
589589

590590
Ok(())

glean-core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ pub fn glean_test_destroy_glean(clear_stores: bool, data_path: Option<String>) {
981981
INITIALIZE_CALLED.store(false, Ordering::SeqCst);
982982
} else if clear_stores {
983983
if let Some(data_path) = data_path {
984-
let _ = remove_dir_all::remove_dir_all(data_path).ok();
984+
let _ = std::fs::remove_dir_all(data_path).ok();
985985
} else {
986986
log::warn!("Asked to clear stores before initialization, but no data path given.");
987987
}

glean-core/src/ping/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ impl PingMaker {
358358
pub fn clear_pending_pings(&self, data_path: &Path) -> Result<()> {
359359
let pings_dir = self.get_pings_dir(data_path, None)?;
360360

361-
remove_dir_all::remove_dir_all(&pings_dir)?;
361+
std::fs::remove_dir_all(&pings_dir)?;
362362
create_dir_all(&pings_dir)?;
363363

364364
log::debug!("All pending pings deleted");

0 commit comments

Comments
 (0)