diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-21 18:44:56 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-21 18:44:56 +0800 |
| commit | 90dcfdd8b81948fa9aabf9ea36761e7d7bc1061b (patch) | |
| tree | 142a4352f8fa146b2e80320d51dc9300dc92f22f /utils/src/legacy/fs.rs | |
| parent | 40b688f44009b5a82855db298be33483d2e2d619 (diff) | |
Remove legacy modules and unused dependencies
Diffstat (limited to 'utils/src/legacy/fs.rs')
| -rw-r--r-- | utils/src/legacy/fs.rs | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/utils/src/legacy/fs.rs b/utils/src/legacy/fs.rs deleted file mode 100644 index 0050cf1..0000000 --- a/utils/src/legacy/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(()) -} |
