diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-19 13:50:48 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-19 13:50:48 +0800 |
| commit | f508de7bc4321db6f3dd71ea43c1cc384b7d6a7f (patch) | |
| tree | 766f6cb4e4c1f9ad594426e6b618c406a429639d /src/cmds/out/path.rs | |
| parent | 74bc8902be593796eb6292151e08374072766e3e (diff) | |
Refactor workspace sheet command to use structured output
Diffstat (limited to 'src/cmds/out/path.rs')
| -rw-r--r-- | src/cmds/out/path.rs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/cmds/out/path.rs b/src/cmds/out/path.rs new file mode 100644 index 0000000..2ddd643 --- /dev/null +++ b/src/cmds/out/path.rs @@ -0,0 +1,39 @@ +use serde::Serialize; +use std::path::PathBuf; + +#[derive(Serialize)] +pub struct JVPathOutput { + pub path: PathBuf, +} + +impl From<PathBuf> for JVPathOutput { + fn from(path: PathBuf) -> Self { + JVPathOutput { path } + } +} + +impl From<JVPathOutput> for PathBuf { + fn from(jv_path: JVPathOutput) -> Self { + jv_path.path + } +} + +impl AsRef<PathBuf> for JVPathOutput { + fn as_ref(&self) -> &PathBuf { + &self.path + } +} + +impl AsRef<std::path::Path> for JVPathOutput { + fn as_ref(&self) -> &std::path::Path { + &self.path + } +} + +impl std::ops::Deref for JVPathOutput { + type Target = PathBuf; + + fn deref(&self) -> &Self::Target { + &self.path + } +} |
