Skip to content

Commit

Permalink
Address All Cargo Build Warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
njfdev committed Aug 22, 2024
1 parent 5d6c44d commit 8b80e89
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src-tauri/src/modes/adsb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use airborne_vel::*;
use aircraft_ident::*;
use log::debug;

use super::{AdsbState, AircraftState};
use super::AircraftState;

pub async fn decode_adsb_msg(me: &[u8], aircraft: &mut AircraftState) {
let type_code = me[0] >> 3;
Expand Down
10 changes: 8 additions & 2 deletions src-tauri/src/modes/arla/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ pub struct RegistrationObject {
#[derive(Deserialize, Debug)]
#[serde(untagged)]
pub enum ApiAircraftRegistrationLookup {
KnownRegistration { registration: RegistrationObject },
LookupError { error: String, message: String },
KnownRegistration {
registration: RegistrationObject,
},
LookupError {
#[allow(dead_code)]
error: String,
message: String,
},
}
2 changes: 1 addition & 1 deletion src-tauri/src/radio_services/soapysdr_adsb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
time::Duration,
};

use blocks::{chunks, Rechunker};
use blocks::Rechunker;
use log::error;
use radiorust::{blocks::io::rf, prelude::*};
use soapysdr::Direction;
Expand Down
29 changes: 16 additions & 13 deletions src-tauri/src/radio_services/soapysdr_radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use radiorust::{
use soapysdr::Direction;
use souvlaki::{MediaControlEvent, MediaControls, MediaMetadata, MediaPlayback, PlatformConfig};
use tauri::{async_runtime, AppHandle, Emitter, Listener, Manager};
use tokio::{self, sync, time};
use tokio::{self, time};

use crate::radiorust_blocks::{
am_demod::AmDemod,
Expand Down Expand Up @@ -115,7 +115,7 @@ impl RtlSdrState {
};

let mut controls = MediaControls::new(config).unwrap();
controls.set_playback(MediaPlayback::Playing { progress: None });
let _ = controls.set_playback(MediaPlayback::Playing { progress: None });

let resource_dir = app.path().resource_dir().unwrap();
let icon_url = format!(
Expand All @@ -128,7 +128,7 @@ impl RtlSdrState {
} else {
"AM Radio"
});
controls.set_metadata(MediaMetadata {
let _ = controls.set_metadata(MediaMetadata {
title: radio_type_name,
cover_url: Some(icon_url.as_str()),
..Default::default()
Expand Down Expand Up @@ -164,12 +164,13 @@ impl RtlSdrState {
}
let mut locked_controls = controls_clone.lock().unwrap();
if *is_paused_locked {
locked_controls
let _ = locked_controls
.set_playback(MediaPlayback::Paused { progress: None });
} else {
locked_controls.set_playback(MediaPlayback::Playing {
progress: None,
});
let _ =
locked_controls.set_playback(MediaPlayback::Playing {
progress: None,
});
}
})
.unwrap();
Expand Down Expand Up @@ -279,12 +280,14 @@ impl RtlSdrState {
// add rbds decoder to output FM stream
let rdbs_decoder =
RbdsDecode::<f32>::new(app.clone(), move |radiotext: String| {
controls_clone2.lock().unwrap().set_metadata(MediaMetadata {
title: Some(&radiotext),
artist: radio_type_name,
cover_url: Some(icon_url.as_str()),
..Default::default()
});
let _ = controls_clone2.lock().unwrap().set_metadata(
MediaMetadata {
title: Some(&radiotext),
artist: radio_type_name,
cover_url: Some(icon_url.as_str()),
..Default::default()
},
);
});
rdbs_decoder.feed_from(&rbds_lowpass_filter);
} else if stream_settings.stream_type == StreamType::AM {
Expand Down
10 changes: 3 additions & 7 deletions src-tauri/src/radiorust_blocks/adsb_decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ use radiorust::{
prelude::{ChunkBufPool, Complex},
signal::Signal,
};
use tauri::{
async_runtime::{self, block_on},
ipc::Channel,
AppHandle, Emitter,
};
use tauri::{ipc::Channel, AppHandle};
use tokio::{spawn, sync::Mutex, time::Instant};
use types::ModeSState;

Expand Down Expand Up @@ -109,7 +105,7 @@ where
.collect();

// send update of data (whether new or not)
let mut modes_channel_mut = modes_channel_clone.lock().await;
let modes_channel_mut = modes_channel_clone.lock().await;
modes_channel_mut.send(modes_state_mut.clone()).unwrap();

let duration = start.elapsed();
Expand Down Expand Up @@ -159,7 +155,7 @@ where

#[cfg(debug_assertions)]
async fn decode_test_modes(
app: AppHandle,
_app: AppHandle,
modes_channel: &mut Channel<ModeSState>,
modes_state: &mut ModeSState,
) {
Expand Down
8 changes: 1 addition & 7 deletions src-tauri/src/radiorust_blocks/pauseable.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use std::sync::{Arc, Mutex};

use biquad::{self, Biquad, Coefficients, DirectForm1, ToHertz, Type, Q_BUTTERWORTH_F64};

use radiorust::{
flow::{new_receiver, new_sender, ReceiverConnector, SenderConnector},
impl_block_trait,
numbers::Float,
prelude::{Chunk, ChunkBufPool, Complex},
prelude::{ChunkBufPool, Complex},
signal::Signal,
};
use tokio::spawn;
Expand Down Expand Up @@ -74,8 +72,4 @@ where
sender_connector,
}
}

fn calc_magnitude(c: Complex<Flt>) -> f64 {
(c.re.powi(2) + c.im.powi(2)).sqrt().into()
}
}

0 comments on commit 8b80e89

Please sign in to comment.