summaryrefslogtreecommitdiff
path: root/utils/src/fs.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-03-12 14:28:08 +0800
committer魏曹先生 <1992414357@qq.com>2026-03-12 14:28:08 +0800
commit0a95bae451c1847f4f0b9601e60959f4e8e6b669 (patch)
tree9e1cfad4f86a73176a4d738b28e7732b66fe5f97 /utils/src/fs.rs
parent8564c8f2177dec0c2c0c031d156347fa6b4485bc (diff)
Refactor display utilities
Diffstat (limited to 'utils/src/fs.rs')
-rw-r--r--utils/src/fs.rs40
1 files changed, 0 insertions, 40 deletions
diff --git a/utils/src/fs.rs b/utils/src/fs.rs
deleted file mode 100644
index 0050cf1..0000000
--- a/utils/src/fs.rs
+++ /dev/null
@@ -1,40 +0,0 @@
-pub async fn move_across_partitions(
- source_path: impl AsRef<std::path::Path>,
- dest_path: impl AsRef<std::path::Path>,
-) -> Result<(), std::io::Error> {
- let source_path = source_path.as_ref();
- let dest_path = dest_path.as_ref();
- if !source_path.exists() {
- return Err(std::io::Error::new(
- std::io::ErrorKind::NotFound,
- "Source file does not exist",
- ));
- }
-
- if let Ok(()) = std::fs::rename(source_path, dest_path) {
- return Ok(());
- }
-
- std::fs::copy(source_path, dest_path)?;
- std::fs::remove_file(source_path)?;
-
- Ok(())
-}
-
-pub async fn copy_across_partitions(
- source_path: impl AsRef<std::path::Path>,
- dest_path: impl AsRef<std::path::Path>,
-) -> Result<(), std::io::Error> {
- let source_path = source_path.as_ref();
- let dest_path = dest_path.as_ref();
- if !source_path.exists() {
- return Err(std::io::Error::new(
- std::io::ErrorKind::NotFound,
- "Source file does not exist",
- ));
- }
-
- std::fs::copy(source_path, dest_path)?;
-
- Ok(())
-}