(path: &Path, recorded_blake3: &str)
| 912 | } |
| 913 | |
| 914 | fn file_state(path: &Path, recorded_blake3: &str) -> FileState { |
| 915 | match std::fs::read(path) { |
| 916 | Ok(bytes) if blake3::hash(&bytes).to_hex().as_str() == recorded_blake3 => { |
| 917 | FileState::Present |
| 918 | } |
| 919 | Ok(_) => FileState::Modified, |
| 920 | Err(error) if error.kind() == ErrorKind::NotFound => FileState::Missing, |
| 921 | Err(_) => FileState::Unreadable, |
| 922 | } |
| 923 | } |
| 924 | |
| 925 | /// Whether a settings file still carries this integration's hook commands. |
| 926 | #[derive(Debug)] |