diff --git a/bin/src/diag.rs b/bin/src/diag.rs index 4c2e43e..440f8be 100644 --- a/bin/src/diag.rs +++ b/bin/src/diag.rs @@ -77,7 +77,7 @@ pub fn run_diag_read_thread(task_tracker: &TaskTracker, mut dev: DiagDevice, mut pub async fn start_recording(State(state): State>) -> Result<(StatusCode, String), (StatusCode, String)> { if state.readonly_mode { - return Err((StatusCode::FORBIDDEN, format!("server is in readonly mode"))); + return Err((StatusCode::FORBIDDEN, "server is in readonly mode".to_string())); } let mut qmdl_store = state.qmdl_store_lock.write().await; let qmdl_file = qmdl_store.new_entry().await @@ -85,17 +85,17 @@ pub async fn start_recording(State(state): State>) -> Result<(S let qmdl_writer = QmdlWriter::new(qmdl_file); state.diag_device_ctrl_sender.send(DiagDeviceCtrlMessage::StartRecording(qmdl_writer)).await .map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, format!("couldn't send stop recording message: {}", e)))?; - Ok((StatusCode::ACCEPTED, format!("ok"))) + Ok((StatusCode::ACCEPTED, "ok".to_string())) } pub async fn stop_recording(State(state): State>) -> Result<(StatusCode, String), (StatusCode, String)> { if state.readonly_mode { - return Err((StatusCode::FORBIDDEN, format!("server is in readonly mode"))); + return Err((StatusCode::FORBIDDEN, "server is in readonly mode".to_string())); } let mut qmdl_store = state.qmdl_store_lock.write().await; qmdl_store.close_current_entry().await .map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, format!("couldn't close current qmdl entry: {}", e)))?; state.diag_device_ctrl_sender.send(DiagDeviceCtrlMessage::StopRecording).await .map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, format!("couldn't send stop recording message: {}", e)))?; - Ok((StatusCode::ACCEPTED, format!("ok"))) + Ok((StatusCode::ACCEPTED, "ok".to_string())) } diff --git a/bin/src/stats.rs b/bin/src/stats.rs index 3ddd088..28d5a81 100644 --- a/bin/src/stats.rs +++ b/bin/src/stats.rs @@ -103,10 +103,10 @@ pub async fn get_system_stats(State(state): State>) -> Result Ok(Json(stats)), Err(err) => { error!("error getting system stats: {}", err); - return Err(( + Err(( StatusCode::INTERNAL_SERVER_ERROR, "error getting system stats".to_string() - )); + )) }, } } diff --git a/lib/src/analysis/lte_downgrade.rs b/lib/src/analysis/lte_downgrade.rs index 9d0f4d4..da73c9d 100644 --- a/lib/src/analysis/lte_downgrade.rs +++ b/lib/src/analysis/lte_downgrade.rs @@ -10,12 +10,10 @@ pub struct LteSib7DowngradeAnalyzer { impl LteSib7DowngradeAnalyzer { fn unpack_system_information<'a>(&self, ie: &'a InformationElement) -> Option<&'a SystemInformation_r8_IEsSib_TypeAndInfo> { - if let InformationElement::LTE(message) = ie { - if let LteInformationElement::BcchDlSch(bcch_dl_sch_message) = message { - 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(LteInformationElement::BcchDlSch(bcch_dl_sch_message)) = 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); } } } diff --git a/telcom-parser/src/lib.rs b/telcom-parser/src/lib.rs index 2e59dd5..17ec14d 100644 --- a/telcom-parser/src/lib.rs +++ b/telcom-parser/src/lib.rs @@ -1,6 +1,6 @@ use asn1_codecs::{uper::UperCodec, PerCodecData, PerCodecError}; use thiserror::Error; -#[allow(unreachable_patterns, non_camel_case_types)] +#[allow(warnings, unused, unreachable_patterns, non_camel_case_types)] pub mod lte_rrc; #[derive(Error, Debug)] @@ -14,5 +14,5 @@ pub fn decode(data: &[u8]) -> Result { let mut asn_data = PerCodecData::from_slice_uper(data); T::uper_decode(&mut asn_data) - .map_err(|e| ParsingError::UperDecodeError(e)) + .map_err(ParsingError::UperDecodeError) }