1use crate::result::RunResult;
2use std::fmt;
3use std::path::PathBuf;
4
5#[derive(Debug, Clone, PartialEq, Eq)]
7pub enum ChangeKind {
8 Added,
10 Modified,
12 Deleted,
14}
15
16impl fmt::Display for ChangeKind {
17 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18 match self {
19 ChangeKind::Added => write!(f, "A"),
20 ChangeKind::Modified => write!(f, "M"),
21 ChangeKind::Deleted => write!(f, "D"),
22 }
23 }
24}
25
26#[derive(Debug, Clone)]
28pub struct Change {
29 pub kind: ChangeKind,
30 pub path: PathBuf,
32}
33
34impl fmt::Display for Change {
35 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
36 write!(f, "{} {}", self.kind, self.path.display())
37 }
38}
39
40#[derive(Debug)]
42pub struct DryRunResult {
43 pub run_result: RunResult,
44 pub changes: Vec<Change>,
45}