mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-27 07:59:59 -07:00
Box some of the larger information element enum variants
An enum is always the size needed to store its largest variant. Some of the variants of the InformationElement and LteInformationElement are substantially larger than the rest. Boxing the larger variants reduces the size of the enum, in some cases by several kilobytes. Since Rust does not currently support destructing a Box via pattern matching, some code that destructures these enums had to be modified.
This commit is contained in:
committed by
Will Greenberg
parent
4edf001ca4
commit
034e0632e4
@@ -26,8 +26,12 @@ impl Analyzer for TestAnalyzer{
|
||||
message: "multiple of 100 events processed".to_string(),
|
||||
})
|
||||
}
|
||||
let InformationElement::LTE(LteInformationElement::PCCH(pcch_msg)) = ie else {
|
||||
return None;
|
||||
let pcch_msg = match ie {
|
||||
InformationElement::LTE(lte_ie) => match &** lte_ie {
|
||||
LteInformationElement::PCCH(pcch_msg) => pcch_msg,
|
||||
_ => return None,
|
||||
}
|
||||
_ => return None,
|
||||
};
|
||||
let PCCH_MessageType::C1(PCCH_MessageType_c1::Paging(paging)) = &pcch_msg.message else {
|
||||
return None;
|
||||
|
||||
Reference in New Issue
Block a user