Skip to content

Commit

Permalink
Remove unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangzhu70 committed Apr 25, 2023
1 parent ec89de8 commit 448c662
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions runtime/src/snapshot_package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use {
rent_collector::RentCollector,
snapshot_archive_info::{SnapshotArchiveInfo, SnapshotArchiveInfoGetter},
snapshot_hash::SnapshotHash,
snapshot_utils::{self, ArchiveFormat, BankSnapshotInfo, Result, SnapshotVersion},
snapshot_utils::{
self, ArchiveFormat, BankSnapshotInfo, Result, SnapshotError, SnapshotVersion,
},
},
log::*,
solana_sdk::{clock::Slot, feature_set, sysvar::epoch_schedule::EpochSchedule},
Expand Down Expand Up @@ -73,10 +75,10 @@ impl AccountsPackage {
}
}

let snapshot_links = bank_snapshot_info
.snapshot_dir
let bank_snapshot_dir = &bank_snapshot_info.snapshot_dir;
let snapshot_links = bank_snapshot_dir
.parent()
.unwrap()
.ok_or_else(|| SnapshotError::InvalidSnapshotDirPath(bank_snapshot_dir.to_path_buf()))?
.to_path_buf();

let snapshot_info = SupplementalSnapshotInfo {
Expand Down

0 comments on commit 448c662

Please sign in to comment.