mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 17:36:19 +04:00
a224ee5079
Co-authored-by: WJH <hou32hou@gmail.com> Co-authored-by: Michael Davis <mcarsondavis@gmail.com> Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
33 lines
638 B
Rust
33 lines
638 B
Rust
use std::path::{Path, PathBuf};
|
|
|
|
pub enum FileChange {
|
|
Untracked {
|
|
path: PathBuf,
|
|
},
|
|
Modified {
|
|
path: PathBuf,
|
|
},
|
|
Conflict {
|
|
path: PathBuf,
|
|
},
|
|
Deleted {
|
|
path: PathBuf,
|
|
},
|
|
Renamed {
|
|
from_path: PathBuf,
|
|
to_path: PathBuf,
|
|
},
|
|
}
|
|
|
|
impl FileChange {
|
|
pub fn path(&self) -> &Path {
|
|
match self {
|
|
Self::Untracked { path } => path,
|
|
Self::Modified { path } => path,
|
|
Self::Conflict { path } => path,
|
|
Self::Deleted { path } => path,
|
|
Self::Renamed { to_path, .. } => to_path,
|
|
}
|
|
}
|
|
}
|