mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-28 16:40:00 -07:00
Fix clippy lints and warnings in Rust 1.89
This will also require Rust 1.89 due to if-let.
This commit is contained in:
@@ -16,19 +16,15 @@ impl LteSib6And7DowngradeAnalyzer {
|
||||
&self,
|
||||
ie: &'a InformationElement,
|
||||
) -> Option<&'a SystemInformation_r8_IEsSib_TypeAndInfo> {
|
||||
if let InformationElement::LTE(lte_ie) = ie {
|
||||
if let LteInformationElement::BcchDlSch(bcch_dl_sch_message) = &**lte_ie {
|
||||
if let BCCH_DL_SCH_MessageType::C1(BCCH_DL_SCH_MessageType_c1::SystemInformation(
|
||||
system_information,
|
||||
)) = &bcch_dl_sch_message.message
|
||||
{
|
||||
if let SystemInformationCriticalExtensions::SystemInformation_r8(sib) =
|
||||
&system_information.critical_extensions
|
||||
{
|
||||
return Some(&sib.sib_type_and_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
if let InformationElement::LTE(lte_ie) = ie
|
||||
&& let LteInformationElement::BcchDlSch(bcch_dl_sch_message) = &**lte_ie
|
||||
&& let BCCH_DL_SCH_MessageType::C1(BCCH_DL_SCH_MessageType_c1::SystemInformation(
|
||||
system_information,
|
||||
)) = &bcch_dl_sch_message.message
|
||||
&& let SystemInformationCriticalExtensions::SystemInformation_r8(sib) =
|
||||
&system_information.critical_extensions
|
||||
{
|
||||
return Some(&sib.sib_type_and_info);
|
||||
}
|
||||
None
|
||||
}
|
||||
@@ -36,11 +32,11 @@ impl LteSib6And7DowngradeAnalyzer {
|
||||
|
||||
// TODO: keep track of SIB state to compare LTE reselection blocks w/ 2g/3g ones
|
||||
impl Analyzer for LteSib6And7DowngradeAnalyzer {
|
||||
fn get_name(&self) -> Cow<str> {
|
||||
fn get_name(&self) -> Cow<'_, str> {
|
||||
Cow::from("LTE SIB 6/7 Downgrade")
|
||||
}
|
||||
|
||||
fn get_description(&self) -> Cow<str> {
|
||||
fn get_description(&self) -> Cow<'_, str> {
|
||||
Cow::from(
|
||||
"Tests for LTE cells broadcasting a SIB type 6 and 7 which include 2G/3G frequencies with higher priorities.",
|
||||
)
|
||||
@@ -62,13 +58,16 @@ impl Analyzer for LteSib6And7DowngradeAnalyzer {
|
||||
for carrier_info in &carrier_info_list.0 {
|
||||
if let Some(CellReselectionPriority(p)) =
|
||||
carrier_info.cell_reselection_priority
|
||||
&& p == 0
|
||||
{
|
||||
if p == 0 {
|
||||
return Some(Event {
|
||||
event_type: EventType::QualitativeWarning { severity: Severity::High },
|
||||
message: "LTE cell advertised a 3G cell for priority 0 reselection".to_string(),
|
||||
});
|
||||
}
|
||||
return Some(Event {
|
||||
event_type: EventType::QualitativeWarning {
|
||||
severity: Severity::High,
|
||||
},
|
||||
message:
|
||||
"LTE cell advertised a 3G cell for priority 0 reselection"
|
||||
.to_string(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,13 +75,16 @@ impl Analyzer for LteSib6And7DowngradeAnalyzer {
|
||||
for carrier_info in &carrier_info_list.0 {
|
||||
if let Some(CellReselectionPriority(p)) =
|
||||
carrier_info.cell_reselection_priority
|
||||
&& p == 0
|
||||
{
|
||||
if p == 0 {
|
||||
return Some(Event {
|
||||
event_type: EventType::QualitativeWarning { severity: Severity::High },
|
||||
message: "LTE cell advertised a 3G cell for priority 0 reselection".to_string(),
|
||||
});
|
||||
}
|
||||
return Some(Event {
|
||||
event_type: EventType::QualitativeWarning {
|
||||
severity: Severity::High,
|
||||
},
|
||||
message:
|
||||
"LTE cell advertised a 3G cell for priority 0 reselection"
|
||||
.to_string(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,17 +98,15 @@ impl Analyzer for LteSib6And7DowngradeAnalyzer {
|
||||
for carrier_info in &carrier_info_list.0 {
|
||||
if let Some(CellReselectionPriority(p)) =
|
||||
carrier_info.common_info.cell_reselection_priority
|
||||
&& p == 0
|
||||
{
|
||||
if p == 0 {
|
||||
return Some(Event {
|
||||
event_type: EventType::QualitativeWarning {
|
||||
severity: Severity::High,
|
||||
},
|
||||
message:
|
||||
"LTE cell advertised a 2G cell for priority 0 reselection"
|
||||
.to_string(),
|
||||
});
|
||||
}
|
||||
return Some(Event {
|
||||
event_type: EventType::QualitativeWarning {
|
||||
severity: Severity::High,
|
||||
},
|
||||
message: "LTE cell advertised a 2G cell for priority 0 reselection"
|
||||
.to_string(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user