Skip to content

Commit

Permalink
bincode deserialize for migrated hashset
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Jan 23, 2025
1 parent 5802184 commit 3885e21
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions sequencer/src/persistence/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,9 @@ impl PersistenceOptions for Options {

let migration_path = path.join("migration");
let migrated = if migration_path.is_file() {
let bytes = fs::read(&path).context(format!(
"unable to read leaf migration from {}",
path.display()
))?;
let json = serde_json::from_slice(&bytes).context("config file is not valid JSON")?;

serde_json::from_value(json).context("malformed config file")?
let bytes = fs::read(&path)
.context(format!("unable to read migration from {}", path.display()))?;
bincode::deserialize(&bytes).context("malformed migration file")?
} else {
HashSet::new()
};
Expand Down

0 comments on commit 3885e21

Please sign in to comment.