[style](trx-rs): apply rustfmt formatting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
+30
-16
@@ -383,7 +383,9 @@ impl DecoderHistories {
|
||||
let before = h.len();
|
||||
Self::prune_aprs(&mut h);
|
||||
self.adjust_total_count(before, h.len());
|
||||
h.iter().map(|(_, pkt): &(Instant, AprsPacket)| pkt.clone()).collect()
|
||||
h.iter()
|
||||
.map(|(_, pkt): &(Instant, AprsPacket)| pkt.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn clear_aprs_history(&self) {
|
||||
@@ -426,7 +428,9 @@ impl DecoderHistories {
|
||||
let before = h.len();
|
||||
Self::prune_hf_aprs(&mut h);
|
||||
self.adjust_total_count(before, h.len());
|
||||
h.iter().map(|(_, pkt): &(Instant, AprsPacket)| pkt.clone()).collect()
|
||||
h.iter()
|
||||
.map(|(_, pkt): &(Instant, AprsPacket)| pkt.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn clear_hf_aprs_history(&self) {
|
||||
@@ -463,7 +467,9 @@ impl DecoderHistories {
|
||||
let before = h.len();
|
||||
Self::prune_cw(&mut h);
|
||||
self.adjust_total_count(before, h.len());
|
||||
h.iter().map(|(_, evt): &(Instant, CwEvent)| evt.clone()).collect()
|
||||
h.iter()
|
||||
.map(|(_, evt): &(Instant, CwEvent)| evt.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn clear_cw_history(&self) {
|
||||
@@ -500,7 +506,9 @@ impl DecoderHistories {
|
||||
let before = h.len();
|
||||
Self::prune_ft8(&mut h);
|
||||
self.adjust_total_count(before, h.len());
|
||||
h.iter().map(|(_, msg): &(Instant, Ft8Message)| msg.clone()).collect()
|
||||
h.iter()
|
||||
.map(|(_, msg): &(Instant, Ft8Message)| msg.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn clear_ft8_history(&self) {
|
||||
@@ -537,7 +545,9 @@ impl DecoderHistories {
|
||||
let before = h.len();
|
||||
Self::prune_ft4(&mut h);
|
||||
self.adjust_total_count(before, h.len());
|
||||
h.iter().map(|(_, msg): &(Instant, Ft8Message)| msg.clone()).collect()
|
||||
h.iter()
|
||||
.map(|(_, msg): &(Instant, Ft8Message)| msg.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn clear_ft4_history(&self) {
|
||||
@@ -574,7 +584,9 @@ impl DecoderHistories {
|
||||
let before = h.len();
|
||||
Self::prune_ft2(&mut h);
|
||||
self.adjust_total_count(before, h.len());
|
||||
h.iter().map(|(_, msg): &(Instant, Ft8Message)| msg.clone()).collect()
|
||||
h.iter()
|
||||
.map(|(_, msg): &(Instant, Ft8Message)| msg.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn clear_ft2_history(&self) {
|
||||
@@ -611,7 +623,9 @@ impl DecoderHistories {
|
||||
let before = h.len();
|
||||
Self::prune_wspr(&mut h);
|
||||
self.adjust_total_count(before, h.len());
|
||||
h.iter().map(|(_, msg): &(Instant, WsprMessage)| msg.clone()).collect()
|
||||
h.iter()
|
||||
.map(|(_, msg): &(Instant, WsprMessage)| msg.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn clear_wspr_history(&self) {
|
||||
@@ -651,7 +665,9 @@ impl DecoderHistories {
|
||||
let before = h.len();
|
||||
Self::prune_lrpt(&mut h);
|
||||
self.adjust_total_count(before, h.len());
|
||||
h.iter().map(|(_, img): &(Instant, LrptImage)| img.clone()).collect()
|
||||
h.iter()
|
||||
.map(|(_, img): &(Instant, LrptImage)| img.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn clear_lrpt_history(&self) {
|
||||
@@ -735,15 +751,13 @@ fn find_device(
|
||||
host.output_devices()
|
||||
};
|
||||
match devices_result {
|
||||
Ok(mut devs) => {
|
||||
match devs.find(|d| d.name().map(|n| n == *name).unwrap_or(false)) {
|
||||
Some(d) => Some(d),
|
||||
None => {
|
||||
warn!("Audio {}: device '{}' not found, retrying", direction, name);
|
||||
None
|
||||
}
|
||||
Ok(mut devs) => match devs.find(|d| d.name().map(|n| n == *name).unwrap_or(false)) {
|
||||
Some(d) => Some(d),
|
||||
None => {
|
||||
warn!("Audio {}: device '{}' not found, retrying", direction, name);
|
||||
None
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
warn!(
|
||||
"Audio {}: failed to enumerate devices, retrying: {}",
|
||||
|
||||
@@ -382,18 +382,15 @@ async fn handle_client(
|
||||
// SGP4 propagation when multiple clients request passes concurrently.
|
||||
if matches!(envelope.cmd, ClientCommand::GetSatPasses) {
|
||||
// Check cache first.
|
||||
let cached = sat_pass_cache
|
||||
.lock()
|
||||
.ok()
|
||||
.and_then(|guard| {
|
||||
guard.as_ref().and_then(|c| {
|
||||
if c.computed_at.elapsed() < SAT_PASS_CACHE_TTL {
|
||||
Some(c.result.clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
});
|
||||
let cached = sat_pass_cache.lock().ok().and_then(|guard| {
|
||||
guard.as_ref().and_then(|c| {
|
||||
if c.computed_at.elapsed() < SAT_PASS_CACHE_TTL {
|
||||
Some(c.result.clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
let result = if let Some(cached_result) = cached {
|
||||
cached_result
|
||||
@@ -693,7 +690,15 @@ mod tests {
|
||||
|
||||
let mut auth = HashSet::new();
|
||||
auth.insert("secret".to_string());
|
||||
let handle = tokio::spawn(run_listener(addr, rigs, default_id, auth, None, ListenerTimeouts::default(), shutdown_rx));
|
||||
let handle = tokio::spawn(run_listener(
|
||||
addr,
|
||||
rigs,
|
||||
default_id,
|
||||
auth,
|
||||
None,
|
||||
ListenerTimeouts::default(),
|
||||
shutdown_rx,
|
||||
));
|
||||
|
||||
let stream = TcpStream::connect(addr).await.expect("connect");
|
||||
let (reader, mut writer) = stream.into_split();
|
||||
|
||||
@@ -486,7 +486,6 @@ impl Ft817 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Rig for Ft817 {
|
||||
|
||||
Reference in New Issue
Block a user