diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-12-15 21:26:37 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-12-15 21:26:37 +0800 |
| commit | ead13b7fe78e8c81478d4c8a4bf20ad1920e380a (patch) | |
| tree | c18967b5a597898a43078ce0b2318684ef880226 /crates/vcs_data/src | |
| parent | 43a373de7dcdc464cb18677b253a1993cd702bd4 (diff) | |
Add getter and setter for last_modifiy_check_hash and remove_mapping
method
Diffstat (limited to 'crates/vcs_data/src')
| -rw-r--r-- | crates/vcs_data/src/data/local/local_sheet.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/vcs_data/src/data/local/local_sheet.rs b/crates/vcs_data/src/data/local/local_sheet.rs index 378d589..4ebdaac 100644 --- a/crates/vcs_data/src/data/local/local_sheet.rs +++ b/crates/vcs_data/src/data/local/local_sheet.rs @@ -199,6 +199,16 @@ impl LocalMappingMetadata { pub fn set_last_modifiy_check_result(&mut self, result: bool) { self.last_modifiy_check_result = result; } + + /// Getter for last_modifiy_check_hash + pub fn last_modifiy_check_hash(&self) -> &Option<String> { + &self.last_modifiy_check_hash + } + + /// Setter for last_modifiy_check_hash + pub fn set_last_modifiy_check_hash(&mut self, hash: Option<String>) { + self.last_modifiy_check_hash = hash; + } } impl Default for LocalMappingMetadata { @@ -291,6 +301,21 @@ impl<'a> LocalSheet<'a> { Ok(()) } + /// Remove mapping from local sheet + pub fn remove_mapping( + &mut self, + path: &LocalFilePathBuf, + ) -> Result<LocalMappingMetadata, std::io::Error> { + let path = format_path(path)?; + match self.data.mapping.remove(&path) { + Some(mapping) => Ok(mapping), + None => Err(Error::new( + std::io::ErrorKind::NotFound, + "Path is not found.", + )), + } + } + /// Get immutable mapping data pub fn mapping_data( &self, |
