Skip to content

Commit

Permalink
Set big arrays as static
Browse files Browse the repository at this point in the history
This fixes some clippy issues.
  • Loading branch information
matzipan authored and helgee committed Jan 23, 2025
1 parent 5ddd617 commit 14fe3da
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/lox-earth/src/cip/xy06/amplitudes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub(crate) const INDICES: [usize; 1309] = [
#[rustfmt::skip]
// @formatter:off (sometimes RustRover ignores the rustfmt skip)
#[allow(clippy::approx_constant)]
pub(crate) const COEFFICIENTS: [Microarcseconds; 4755] = [
pub(crate) static COEFFICIENTS: [Microarcseconds; 4755] = [
-6844318.44, 9205236.26,1328.67,1538.18, 205833.11,
153041.79, -3309.73, 853.32,2037.98, -2301.27,
81.46, 120.56, -20.39, -15.22, 1.73, -1.61, -0.10, 0.11,
Expand Down
2 changes: 1 addition & 1 deletion crates/lox-earth/src/cip/xy06/luni_solar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(crate) const N_FREQUENCY_LISTS: usize = 653;

#[rustfmt::skip]
// @formatter:off (sometimes RustRover ignores the rustfmt skip)
pub(crate) const FREQUENCY_LISTS: [LuniSolarFrequencyList; N_FREQUENCY_LISTS] = [
pub(crate) static FREQUENCY_LISTS: [LuniSolarFrequencyList; N_FREQUENCY_LISTS] = [
[0.0, 0.0, 0.0, 0.0, 1.0],
[0.0, 0.0, 2.0, -2.0, 2.0],
[0.0, 0.0, 2.0, 0.0, 2.0],
Expand Down
2 changes: 1 addition & 1 deletion crates/lox-earth/src/cip/xy06/planetary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub(crate) type PlanetaryFrequencyList = [f64; 14];

#[rustfmt::skip]
// @formatter:off (sometimes RustRover ignores the rustfmt skip)
pub(crate) const FREQUENCY_LISTS: [PlanetaryFrequencyList; 656] = [
pub(crate) static FREQUENCY_LISTS: [PlanetaryFrequencyList; 656] = [
[0.0, 0.0, 1.0, -1.0, 1.0, 0.0, 0.0, -1.0, 0.0, -2.0, 5.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, -5.0, 0.0, 0.0, -1.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::nutation::iau2000::LuniSolarCoefficients;

#[rustfmt::skip]
// @formatter:off (sometimes RustRover ignores the rustfmt skip)
pub(super) const COEFFICIENTS: [LuniSolarCoefficients; 678] = [
pub(super) static COEFFICIENTS: [LuniSolarCoefficients; 678] = [
LuniSolarCoefficients{ l: 0.0, lp: 0.0, f: 0.0, d: 0.0, om: 1.0, sin_psi: -172064161.0, sin_psi_t: -174666.0, cos_psi: 33386.0, cos_eps: 92052331.0, cos_eps_t: 9086.0, sin_eps: 15377.0},
LuniSolarCoefficients{ l: 0.0, lp: 0.0, f: 2.0, d: -2.0, om: 2.0, sin_psi: -13170906.0, sin_psi_t: -1675.0, cos_psi: -13696.0, cos_eps: 5730336.0, cos_eps_t: -3015.0, sin_eps: -4587.0},
LuniSolarCoefficients{ l: 0.0, lp: 0.0, f: 2.0, d: 0.0, om: 2.0, sin_psi: -2276413.0, sin_psi_t: -234.0, cos_psi: 2796.0, cos_eps: 978459.0, cos_eps_t: -485.0, sin_eps: 1374.0},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::PlanetaryCoefficients;

#[rustfmt::skip]
// @formatter:off (sometimes RustRover ignores the rustfmt skip)
pub(super) const COEFFICIENTS: [PlanetaryCoefficients; 687] = [
pub(super) static COEFFICIENTS: [PlanetaryCoefficients; 687] = [
PlanetaryCoefficients{ l: 0.0, f: 0.0, d: 0.0, om: 0.0, mercury: 0.0, venus: 0.0, earth: 8.0, mars: -16.0, jupiter: 4.0, saturn: 5.0, uranus: 0.0, neptune: 0.0, pa: 0.0, sin_psi: 1440.0, cos_psi: 0.0, sin_eps: 0.0, cos_eps: 0.0},
PlanetaryCoefficients{ l: 0.0, f: 0.0, d: 0.0, om: 0.0, mercury: 0.0, venus: 0.0, earth: -8.0, mars: 16.0, jupiter: -4.0, saturn: -5.0, uranus: 0.0, neptune: 0.0, pa: 2.0, sin_psi: 56.0, cos_psi: -117.0, sin_eps: -42.0, cos_eps: -40.0},
PlanetaryCoefficients{ l: 0.0, f: 0.0, d: 0.0, om: 0.0, mercury: 0.0, venus: 0.0, earth: 8.0, mars: -16.0, jupiter: 4.0, saturn: 5.0, uranus: 0.0, neptune: 0.0, pa: 2.0, sin_psi: 125.0, cos_psi: -43.0, sin_eps: 0.0, cos_eps: -54.0},
Expand Down

0 comments on commit 14fe3da

Please sign in to comment.