mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-28 00:20:00 -07:00
Fix clippy complaints
This commit is contained in:
committed by
Markus Unterwaditzer
parent
2b86691e57
commit
94289dcad5
@@ -175,7 +175,7 @@ impl Harness {
|
||||
let qmdl_message = match maybe_qmdl_message {
|
||||
Ok(msg) => msg,
|
||||
Err(err) => {
|
||||
row.skipped_message_reasons.push(format!("{:?}", err));
|
||||
row.skipped_message_reasons.push(format!("{err:?}"));
|
||||
continue;
|
||||
}
|
||||
};
|
||||
@@ -183,7 +183,7 @@ impl Harness {
|
||||
let gsmtap_message = match gsmtap_parser::parse(qmdl_message) {
|
||||
Ok(msg) => msg,
|
||||
Err(err) => {
|
||||
row.skipped_message_reasons.push(format!("{:?}", err));
|
||||
row.skipped_message_reasons.push(format!("{err:?}"));
|
||||
continue;
|
||||
}
|
||||
};
|
||||
@@ -195,7 +195,7 @@ impl Harness {
|
||||
let element = match InformationElement::try_from(&gsmtap_msg) {
|
||||
Ok(element) => element,
|
||||
Err(err) => {
|
||||
row.skipped_message_reasons.push(format!("{:?}", err));
|
||||
row.skipped_message_reasons.push(format!("{err:?}"));
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ impl Analyzer for ConnectionRedirect2GDowngradeAnalyzer {
|
||||
}),
|
||||
_ => Some(Event {
|
||||
event_type: EventType::Informational,
|
||||
message: format!("RRCConnectionRelease CarrierInfo: {:?}", carrier_info),
|
||||
message: format!("RRCConnectionRelease CarrierInfo: {carrier_info:?}"),
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
use std::any::Any;
|
||||
use std::borrow::Cow;
|
||||
|
||||
use pycrate_rs::nas::emm::EMMMessage;
|
||||
use pycrate_rs::nas::generated::emm::emm_identity_request::{EMMIdentityRequest, IDTypeV};
|
||||
use pycrate_rs::nas::generated::emm::emm_identity_request::IDTypeV;
|
||||
use pycrate_rs::nas::NASMessage;
|
||||
|
||||
use super::analyzer::{Analyzer, Event, EventType, Severity};
|
||||
@@ -54,10 +53,9 @@ impl Analyzer for ImsiRequestedAnalyzer {
|
||||
},
|
||||
message: format!(
|
||||
"NAS IMSI identity request detected, however it was within \
|
||||
the first {} packets of this analysis. If you just \
|
||||
the first {PACKET_THRESHHOLD} packets of this analysis. If you just \
|
||||
turned your device on, this is likely a \
|
||||
false-positive.",
|
||||
PACKET_THRESHHOLD
|
||||
false-positive."
|
||||
),
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -104,8 +104,7 @@ impl DiagDevice {
|
||||
match Self::try_new().await {
|
||||
Ok(device) => {
|
||||
info!(
|
||||
"Diag device initialization succeeded after {} retries",
|
||||
num_retries
|
||||
"Diag device initialization succeeded after {num_retries} retries"
|
||||
);
|
||||
return Ok(device);
|
||||
}
|
||||
@@ -113,15 +112,13 @@ impl DiagDevice {
|
||||
num_retries += 1;
|
||||
if start_time.elapsed() >= max_duration {
|
||||
error!(
|
||||
"Failed to initialize diag device after {:?}: {}",
|
||||
max_duration, e
|
||||
"Failed to initialize diag device after {max_duration:?}: {e}"
|
||||
);
|
||||
return Err(e);
|
||||
}
|
||||
|
||||
info!(
|
||||
"Diag device initialization failed {} times, retrying in {:?}: {}",
|
||||
num_retries, delay, e
|
||||
"Diag device initialization failed {num_retries} times, retrying in {delay:?}: {e}"
|
||||
);
|
||||
sleep(delay).await;
|
||||
|
||||
@@ -240,7 +237,7 @@ impl DiagDevice {
|
||||
}
|
||||
_ => info!("skipping non-LogConfigResponse response..."),
|
||||
},
|
||||
Err(e) => error!("error parsing message: {:?}", e),
|
||||
Err(e) => error!("error parsing message: {e:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +265,7 @@ impl DiagDevice {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
Err(e) => error!("error parsing message: {:?}", e),
|
||||
Err(e) => error!("error parsing message: {e:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +279,7 @@ impl DiagDevice {
|
||||
for (log_type, &log_mask_bitsize) in log_mask_sizes.iter().enumerate() {
|
||||
if log_mask_bitsize > 0 {
|
||||
self.set_log_mask(log_type as u32, log_mask_bitsize).await?;
|
||||
info!("enabled logging for log type {}", log_type);
|
||||
info!("enabled logging for log type {log_type}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,8 +344,7 @@ fn enable_frame_readwrite(fd: i32, mode: u32) -> DiagResult<()> {
|
||||
|
||||
if ret < 0 {
|
||||
let msg = format!(
|
||||
"DIAG_IOCTL_SWITCH_LOGGING ioctl failed with error code {}",
|
||||
ret
|
||||
"DIAG_IOCTL_SWITCH_LOGGING ioctl failed with error code {ret}"
|
||||
);
|
||||
return Err(DiagDeviceError::InitializationFailed(msg));
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ fn log_to_gsmtap(value: LogBody) -> Result<Option<GsmtapMessage>, GsmtapParserEr
|
||||
}))
|
||||
}
|
||||
_ => {
|
||||
error!("gsmtap_sink: ignoring unhandled log type: {:?}", value);
|
||||
error!("gsmtap_sink: ignoring unhandled log type: {value:?}");
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user