diff options
| author | Mel <einebeere@gmail.com> | 2021-10-02 21:30:03 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2021-10-02 21:30:03 +0200 |
| commit | cf01169e467f4ac36d2d8b9ce13e7bbc81d46aa5 (patch) | |
| tree | d3b415c9480ff6d57b98d6f4355bd37636b7dd2e /src/history.rs | |
| parent | 55da5ae8cf731c768d6cc580693068e64234a4af (diff) | |
| download | ka-cf01169e467f4ac36d2d8b9ce13e7bbc81d46aa5.tar.zst ka-cf01169e467f4ac36d2d8b9ce13e7bbc81d46aa5.zip | |
Immutable Fs implementation and replaced exists calls.
Diffstat (limited to 'src/history.rs')
| -rw-r--r-- | src/history.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/history.rs b/src/history.rs index 4f23790..d023330 100644 --- a/src/history.rs +++ b/src/history.rs @@ -13,7 +13,7 @@ pub struct RepositoryHistory { } impl RepositoryHistory { - pub fn from_file<FS: Fs>(fs: &mut FS, file: &mut FS::File) -> Result<RepositoryHistory> { + pub fn from_file<FS: Fs>(fs: &FS, file: &mut FS::File) -> Result<RepositoryHistory> { let buffer = fs .read_from_file(file) .context("Failed reading repository history.")?; @@ -22,7 +22,7 @@ impl RepositoryHistory { repository_history.context("Corrupted repository history.") } - pub fn write_to_file<FS: Fs>(&self, fs: &mut FS, file: &mut FS::File) -> anyhow::Result<()> { + pub fn write_to_file<FS: Fs>(&self, fs: &FS, file: &mut FS::File) -> anyhow::Result<()> { let encoded: Vec<u8> = serde_json::to_vec(self)?; fs.write_to_file(file, encoded)?; Ok(()) @@ -58,7 +58,7 @@ pub struct FileHistory { } impl FileHistory { - pub fn from_file<FS: Fs>(fs: &mut FS, file: &mut FS::File) -> Result<FileHistory> { + pub fn from_file<FS: Fs>(fs: &FS, file: &mut FS::File) -> Result<FileHistory> { let buffer = fs .read_from_file(file) .context("Failed reading file history.")?; @@ -67,7 +67,7 @@ impl FileHistory { file_history.context("Corrupted file history.") } - pub fn write_to_file<FS: Fs>(&self, fs: &mut FS, file: &mut FS::File) -> Result<()> { + pub fn write_to_file<FS: Fs>(&self, fs: &FS, file: &mut FS::File) -> Result<()> { let encoded: Vec<u8> = serde_json::to_vec(self)?; fs.write_to_file(file, encoded)?; Ok(()) |
