Skip to content

Commit

Permalink
Update fs-storage/src/file_storage.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Tarek Elsayed <60650661+tareknaser@users.noreply.github.com>
  • Loading branch information
twitu and tareknaser authored Mar 12, 2024
1 parent ae06033 commit 694194d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions fs-storage/src/file_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ impl FileStorage {
.parse::<i32>()
.unwrap();

match version.cmp(&STORAGE_VERSION) {
std::cmp::Ordering::Equal => Ok(()),
std::cmp::Ordering::Less => Err(ArklibError::Storage(
self.label.clone(),
"Storage format is newer than the app".to_owned(),
)),
std::cmp::Ordering::Greater => Err(ArklibError::Storage(
if version != STORAGE_VERSION {
return Err(ArklibError::Storage(
self.label.clone(),
"Storage format is older than the app".to_owned(),
)),
format!(
"Storage version mismatch: expected {}, found {}",
STORAGE_VERSION, version
),
));
}

Ok(())
}
}

Expand Down

0 comments on commit 694194d

Please sign in to comment.