Skip to content

Commit

Permalink
panic in bad circumstances
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Sep 17, 2024
1 parent 9c26752 commit 63df7a8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,10 @@ impl Storage for FSStorage {

fn load_sig(&self, path: &str) -> Result<SigStore> {
let raw = self.load(path)?;
let sig = Signature::from_reader(&mut &raw[..])?
// TODO: select the right sig?
.swap_remove(0);

let mut vs = Signature::from_reader(&mut &raw[..])?;
if vs.len() > 1 { panic!("more than one sig."); }
let sig = vs.swap_remove(0);

Ok(sig.into())
}
Expand Down

0 comments on commit 63df7a8

Please sign in to comment.