[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:
2026-03-29 14:28:53 +02:00
parent ec1d46829f
commit ef9d97d4b5
9 changed files with 279 additions and 106 deletions
+8 -5
View File
@@ -468,11 +468,14 @@ fn find_passes_for_sat(
start_ms: i64,
window_ms: i64,
) -> Vec<PassPrediction> {
let elements =
match Elements::from_tle(Some(entry.name.clone()), entry.line1.as_bytes(), entry.line2.as_bytes()) {
Ok(e) => e,
Err(_) => return vec![],
};
let elements = match Elements::from_tle(
Some(entry.name.clone()),
entry.line1.as_bytes(),
entry.line2.as_bytes(),
) {
Ok(e) => e,
Err(_) => return vec![],
};
let constants = match Constants::from_elements(&elements) {
Ok(c) => c,
Err(_) => return vec![],
+6 -9
View File
@@ -15,15 +15,12 @@ use crate::rig::response::RigError;
fn apply_jitter(delay: Duration) -> Duration {
// Simple deterministic-ish jitter using the current instant's low bits.
// We avoid pulling in `rand` for this single use.
let nanos = std::time::Instant::now()
.elapsed()
.as_nanos()
.wrapping_add(
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap_or_default()
.as_nanos(),
);
let nanos = std::time::Instant::now().elapsed().as_nanos().wrapping_add(
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap_or_default()
.as_nanos(),
);
// Map to range [0.75, 1.25]
let frac = (nanos % 1000) as f64 / 1000.0; // 0.0 .. 1.0
let factor = 0.75 + frac * 0.5; // 0.75 .. 1.25