diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-01-12 04:28:28 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-01-12 04:51:34 +0800 |
| commit | c5fb22694e95f12c24b8d8af76999be7aea3fcec (patch) | |
| tree | 399d8a24ce491fb635f3d09f2123290fe784059e /crates/vcs_data/src/data/user.rs | |
| parent | 444754489aca0454eb54e15a49fb8a6db0b68a07 (diff) | |
Reorganize crate structure and move documentation files
Diffstat (limited to 'crates/vcs_data/src/data/user.rs')
| -rw-r--r-- | crates/vcs_data/src/data/user.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/crates/vcs_data/src/data/user.rs b/crates/vcs_data/src/data/user.rs deleted file mode 100644 index 9f52fdc..0000000 --- a/crates/vcs_data/src/data/user.rs +++ /dev/null @@ -1,28 +0,0 @@ -use crate::current::current_cfg_dir; -use std::path::PathBuf; - -pub mod accounts; - -pub struct UserDirectory { - local_path: PathBuf, -} - -impl UserDirectory { - /// Create a user ditectory struct from the current system's document directory - pub fn current_cfg_dir() -> Option<Self> { - Some(UserDirectory { - local_path: current_cfg_dir()?, - }) - } - - /// Create a user directory struct from a specified directory path - /// Returns None if the directory does not exist - pub fn from_path<P: Into<PathBuf>>(path: P) -> Option<Self> { - let local_path = path.into(); - if local_path.exists() { - Some(UserDirectory { local_path }) - } else { - None - } - } -} |
