From fd2444b51a46bd0c13407f4067244417b6e6f9ed Mon Sep 17 00:00:00 2001 From: gwbres Date: Thu, 21 Mar 2024 09:20:25 +0100 Subject: [PATCH] OBS_RINEX formatting: fix tiny issues when formatting header section (#212) * OBS_RINEX formatting: fix tiny issues when formatting header section * removed unused variable * unlock meteo_v3 formatting test --------- Signed-off-by: Guillaume W. Bres --- rinex/src/header.rs | 7 +++++-- rinex/src/lib.rs | 20 ++++++++++++++------ rinex/src/tests/production.rs | 12 +++++++++++- test_resources/MET/V3/.gitkeep | 0 4 files changed, 30 insertions(+), 9 deletions(-) delete mode 100644 test_resources/MET/V3/.gitkeep diff --git a/rinex/src/header.rs b/rinex/src/header.rs index 1cf330381..63afc1f00 100644 --- a/rinex/src/header.rs +++ b/rinex/src/header.rs @@ -1613,8 +1613,11 @@ impl Header { for (constell, observables) in &obs.codes { let mut descriptor = String::new(); descriptor.push_str(&format!("{:x}{:5}", constell, observables.len())); - for observable in observables { - descriptor.push_str(&format!(" {}", observable)); + for (i, observable) in observables.iter().enumerate() { + if (i % 13) == 0 && (i > 0) { + descriptor.push_str(&format!(" ")); // TAB + } + descriptor.push_str(&format!(" {}", observable)); // TAB } writeln!(f, "{}", fmt_rinex(&descriptor, "SYS / # / OBS TYPES"))?; } diff --git a/rinex/src/lib.rs b/rinex/src/lib.rs index d604f4e2d..1ce62f1d7 100644 --- a/rinex/src/lib.rs +++ b/rinex/src/lib.rs @@ -147,12 +147,8 @@ pub(crate) fn fmt_rinex(content: &str, marker: &str) -> String { for i in 0..nb_lines { let start_off = i * 60; let end_off = std::cmp::min(start_off + 60, content.len()); - string.push_str(&format!( - "{: