From 608594882646afab7660560de8db186db44e4071 Mon Sep 17 00:00:00 2001 From: AngusGMorrison Date: Sun, 5 Nov 2023 14:24:44 +0000 Subject: [PATCH] Rustfmt --- crates/lox_core/src/bodies.rs | 2 +- tools/lox_gen/src/main.rs | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/lox_core/src/bodies.rs b/crates/lox_core/src/bodies.rs index ae26650f..97b2da98 100644 --- a/crates/lox_core/src/bodies.rs +++ b/crates/lox_core/src/bodies.rs @@ -74,9 +74,9 @@ pub trait RotationalElements: Copy { #[cfg(test)] mod tests { - use super::*; use super::planets::Earth; use super::satellites::Moon; + use super::*; #[test] fn test_naif_id() { diff --git a/tools/lox_gen/src/main.rs b/tools/lox_gen/src/main.rs index 38b3eab3..c1b0dc9c 100644 --- a/tools/lox_gen/src/main.rs +++ b/tools/lox_gen/src/main.rs @@ -14,7 +14,7 @@ use proc_macro2::{Ident, TokenStream}; use quote::{format_ident, quote}; use lox_io::spice::Kernel; -use naif_ids::{BARYCENTERS, Body, MINOR_BODIES, PLANETS, SATELLITES, SUN}; +use naif_ids::{Body, BARYCENTERS, MINOR_BODIES, PLANETS, SATELLITES, SUN}; mod naif_ids; @@ -39,7 +39,11 @@ pub fn main() { .expect("parsing should succeed"); let data = Data { pck, gm }; let bodies: [(&str, Vec, Vec); 5] = [ - ("sun", Vec::from(SUN), vec![naif_id, point_mass, spheroid, rotational_elements]), + ( + "sun", + Vec::from(SUN), + vec![naif_id, point_mass, spheroid, rotational_elements], + ), ( "barycenters", Vec::from(BARYCENTERS), @@ -317,7 +321,7 @@ fn rotational_elements( ) { let shared_imports = vec![ format_ident!("RotationalElements"), - format_ident!("RACoefficients") + format_ident!("RACoefficients"), ]; for import in shared_imports { @@ -355,12 +359,10 @@ fn get_ra_coefficients(id: &i32, data: &Data) -> Option<(f64, f64, f64)> { let key = format!("BODY{id}_POLE_RA"); match data.pck.get_double_array(&key) { None => None, - Some(polynomials) if polynomials.len() == 2 => { - Some((polynomials[0], polynomials[1], 0.0)) - }, + Some(polynomials) if polynomials.len() == 2 => Some((polynomials[0], polynomials[1], 0.0)), Some(polynomials) if polynomials.len() == 3 => { Some((polynomials[0], polynomials[1], polynomials[2])) - }, + } Some(polynomials) => { panic!( "PCK DoubleArray with key {} had size {}, expected 2 <= size <= 3",