Skip to content

Commit

Permalink
Run clippy (#227)
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume W. Bres <[email protected]>
  • Loading branch information
gwbres authored Mar 31, 2024
1 parent e05eb6b commit 96bcf85
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 28 deletions.
5 changes: 2 additions & 3 deletions rinex-cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,9 @@ Otherwise it gets automatically picked up."))
pub fn manual_position(&self) -> Option<(f64, f64, f64)> {
if let Some(position) = self.manual_ecef() {
Some(position)
} else if let Some(position) = self.manual_geodetic() {
Some(GroundPosition::from_geodetic(position).to_ecef_wgs84())
} else {
None
self.manual_geodetic()
.map(|position| GroundPosition::from_geodetic(position).to_ecef_wgs84())
}
}
}
7 changes: 2 additions & 5 deletions rinex-cli/src/graph/record/navigation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,8 @@ fn ctx_sv_clock_corrections(
ProductType::Radio => Some(sv_eph.sv_clock()),
ProductType::HighPrecisionSp3 => {
if let Some(sp3) = sp3 {
if let Some(bias) = sp3.sv_clock_interpolate(*t, *sv) {
Some((bias, 0.0_f64, 0.0_f64))
} else {
None
}
sp3.sv_clock_interpolate(*t, *sv)
.map(|bias| (bias, 0.0_f64, 0.0_f64))
} else {
None
}
Expand Down
2 changes: 1 addition & 1 deletion rinex/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,7 @@ impl Header {
descriptor.push_str(&format!("{:x}{:5}", constell, observables.len()));
for (i, observable) in observables.iter().enumerate() {
if (i % 13) == 0 && (i > 0) {
descriptor.push_str(&format!(" ")); // TAB
descriptor.push_str(" "); // TAB
}
descriptor.push_str(&format!(" {}", observable)); // TAB
}
Expand Down
36 changes: 17 additions & 19 deletions rinex/src/observation/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,20 @@ pub(crate) fn is_new_epoch(line: &str, v: Version) -> bool {
false
} else {
// SPLICE flag handling (still an Observation::flag)
let significant = line[0..26].trim().len() != 0;
let significant = !line[0..26].trim().is_empty();
let epoch = epoch::parse_utc(&line[0..26]);
let flag = EpochFlag::from_str(&line[26..29].trim());
let flag = EpochFlag::from_str(line[26..29].trim());
if significant {
epoch.is_ok() && flag.is_ok()
} else if flag.is_err() {
false
} else {
if flag.is_err() {
false
} else {
match flag.unwrap() {
EpochFlag::AntennaBeingMoved
| EpochFlag::NewSiteOccupation
| EpochFlag::HeaderInformationFollows
| EpochFlag::ExternalEvent => true,
_ => false,
}
match flag.unwrap() {
EpochFlag::AntennaBeingMoved
| EpochFlag::NewSiteOccupation
| EpochFlag::HeaderInformationFollows
| EpochFlag::ExternalEvent => true,
_ => false,
}
}
}
Expand Down Expand Up @@ -312,13 +310,13 @@ fn parse_normal(
}

fn parse_event(
header: &Header,
epoch: Epoch,
flag: EpochFlag,
n_records: u16,
clock_offset: Option<f64>,
rem: &str,
mut lines: std::str::Lines<'_>,
_header: &Header,
_epoch: Epoch,
_flag: EpochFlag,
_n_records: u16,
_clock_offset: Option<f64>,
_rem: &str,
_lines: std::str::Lines<'_>,
) -> Result<
(
(Epoch, EpochFlag),
Expand Down

0 comments on commit 96bcf85

Please sign in to comment.