Skip to content

Commit

Permalink
A bit nicer panics for incomplete data files
Browse files Browse the repository at this point in the history
  • Loading branch information
marieell authored Feb 6, 2022
1 parent 4124964 commit c1e2670
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions decodeme/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ impl EventDecoder {

let mut split_data = measureme::split_streams(&entire_file_data[FILE_HEADER_SIZE..]);

let string_data = split_data.remove(&PageTag::StringData).unwrap();
let index_data = split_data.remove(&PageTag::StringIndex).unwrap();
let event_data = split_data.remove(&PageTag::Events).unwrap();
let string_data = split_data.remove(&PageTag::StringData).expect("Invalid file: No string data found");
let index_data = split_data.remove(&PageTag::StringIndex).expect("Invalid file: No string index data found");
let event_data = split_data.remove(&PageTag::Events).expect("Invalid file: No event data found");

Self::from_separate_buffers(string_data, index_data, event_data, diagnostic_file_path)
}
Expand Down

0 comments on commit c1e2670

Please sign in to comment.