Skip to content

Commit 1aa0d03

Browse files
Cargo fmt
1 parent 110a178 commit 1aa0d03

File tree

17 files changed

+94
-115
lines changed

17 files changed

+94
-115
lines changed

src/cosmic/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ pub trait TimeTagged {
4242
pub trait State: Default + Copy + PartialEq + fmt::Display + fmt::LowerExp + Send + Sync
4343
where
4444
Self: Sized,
45-
DefaultAllocator: Allocator< Self::Size>
46-
+ Allocator< Self::Size, Self::Size>
47-
+ Allocator< Self::VecLength>,
45+
DefaultAllocator:
46+
Allocator<Self::Size> + Allocator<Self::Size, Self::Size> + Allocator<Self::VecLength>,
4847
{
4948
/// Size of the state and its STM
5049
type Size: DimName;
@@ -85,7 +84,7 @@ where
8584
vector: &OVector<f64, Self::VecLength>,
8685
) -> Self
8786
where
88-
DefaultAllocator: Allocator< Self::VecLength>,
87+
DefaultAllocator: Allocator<Self::VecLength>,
8988
{
9089
self.set(self.epoch() + delta_t_s, vector);
9190
self

src/io/tracking_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl DynamicTrackingArc {
8989
pub fn to_tracking_arc<Msr>(&self) -> Result<TrackingArc<Msr>, InputOutputError>
9090
where
9191
Msr: Measurement,
92-
DefaultAllocator: Allocator< Msr::MeasurementSize>,
92+
DefaultAllocator: Allocator<Msr::MeasurementSize>,
9393
{
9494
// Read the file since we closed it earlier
9595
let file = File::open(&self.path).context(StdIOSnafu {

src/io/trajectory_data.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ impl TrajectoryLoader {
9999
pub fn to_traj<S>(&self) -> Result<Traj<S>, InputOutputError>
100100
where
101101
S: Interpolatable,
102-
DefaultAllocator: Allocator< S::VecLength>
103-
+ Allocator< S::Size>
104-
+ Allocator< S::Size, S::Size>,
102+
DefaultAllocator:
103+
Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
105104
{
106105
// Check the schema
107106
let mut has_epoch = false; // Required

src/md/events/details.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ pub enum EventEdge {
4949
#[derive(Clone, Debug, PartialEq)]
5050
pub struct EventDetails<S: Interpolatable>
5151
where
52-
DefaultAllocator:
53-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
52+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
5453
{
5554
/// The state of the trajectory at the found event.
5655
pub state: S,
@@ -70,8 +69,7 @@ where
7069

7170
impl<S: Interpolatable> EventDetails<S>
7271
where
73-
DefaultAllocator:
74-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
72+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
7573
{
7674
/// Generates detailed information about an event at a specific epoch in a trajectory.
7775
///
@@ -148,8 +146,7 @@ where
148146

149147
impl<S: Interpolatable> fmt::Display for EventDetails<S>
150148
where
151-
DefaultAllocator:
152-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
149+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
153150
{
154151
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
155152
let prev_fmt = match self.prev_value {
@@ -173,17 +170,15 @@ where
173170
#[derive(Clone, Debug, PartialEq)]
174171
pub struct EventArc<S: Interpolatable>
175172
where
176-
DefaultAllocator:
177-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
173+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
178174
{
179175
pub rise: EventDetails<S>,
180176
pub fall: EventDetails<S>,
181177
}
182178

183179
impl<S: Interpolatable> fmt::Display for EventArc<S>
184180
where
185-
DefaultAllocator:
186-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
181+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
187182
{
188183
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
189184
write!(

src/md/events/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ use std::sync::Arc;
3535
/// A trait to specify how a specific event must be evaluated.
3636
pub trait EventEvaluator<S: State>: fmt::Display + Send + Sync
3737
where
38-
DefaultAllocator:
39-
Allocator< S::Size> + Allocator< S::Size, S::Size> + Allocator< S::VecLength>,
38+
DefaultAllocator: Allocator<S::Size> + Allocator<S::Size, S::Size> + Allocator<S::VecLength>,
4039
{
4140
// Evaluation of event crossing, must return whether the condition happened between between both states.
4241
fn eval_crossing(

src/md/events/search.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ use std::sync::Arc;
3232

3333
impl<S: Interpolatable> Traj<S>
3434
where
35-
DefaultAllocator:
36-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
35+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
3736
{
3837
/// Find the exact state where the request event happens. The event function is expected to be monotone in the provided interval because we find the event using a Brent solver.
3938
#[allow(clippy::identity_op)]

src/md/trajectory/interpolatable.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ use enum_iterator::all;
3333
pub trait Interpolatable: State
3434
where
3535
Self: Sized,
36-
DefaultAllocator: Allocator< Self::Size>
37-
+ Allocator< Self::Size, Self::Size>
38-
+ Allocator< Self::VecLength>,
36+
DefaultAllocator:
37+
Allocator<Self::Size> + Allocator<Self::Size, Self::Size> + Allocator<Self::VecLength>,
3938
{
4039
/// Interpolates a new state at the provided epochs given a slice of states.
4140
fn interpolate(self, epoch: Epoch, states: &[Self]) -> Result<Self, InterpolationError>;

src/md/trajectory/traj.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ use std::sync::Arc;
4747
#[derive(Clone, PartialEq)]
4848
pub struct Traj<S: Interpolatable>
4949
where
50-
DefaultAllocator:
51-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
50+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
5251
{
5352
/// Optionally name this trajectory
5453
pub name: Option<String>,
@@ -58,8 +57,7 @@ where
5857

5958
impl<S: Interpolatable> Traj<S>
6059
where
61-
DefaultAllocator:
62-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
60+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
6361
{
6462
pub fn new() -> Self {
6563
Self {
@@ -518,8 +516,7 @@ where
518516

519517
impl<S: Interpolatable> ops::Add for Traj<S>
520518
where
521-
DefaultAllocator:
522-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
519+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
523520
{
524521
type Output = Result<Traj<S>, NyxError>;
525522

@@ -531,8 +528,7 @@ where
531528

532529
impl<S: Interpolatable> ops::Add<&Traj<S>> for &Traj<S>
533530
where
534-
DefaultAllocator:
535-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
531+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
536532
{
537533
type Output = Result<Traj<S>, NyxError>;
538534

@@ -578,8 +574,7 @@ where
578574

579575
impl<S: Interpolatable> ops::AddAssign<&Traj<S>> for Traj<S>
580576
where
581-
DefaultAllocator:
582-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
577+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
583578
{
584579
/// Attempt to add two trajectories together and assign it to `self`
585580
///
@@ -593,8 +588,7 @@ where
593588

594589
impl<S: Interpolatable> fmt::Display for Traj<S>
595590
where
596-
DefaultAllocator:
597-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
591+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
598592
{
599593
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
600594
if self.states.is_empty() {
@@ -621,8 +615,7 @@ where
621615

622616
impl<S: Interpolatable> fmt::Debug for Traj<S>
623617
where
624-
DefaultAllocator:
625-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
618+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
626619
{
627620
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
628621
write!(f, "{self}",)
@@ -631,8 +624,7 @@ where
631624

632625
impl<S: Interpolatable> Default for Traj<S>
633626
where
634-
DefaultAllocator:
635-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
627+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
636628
{
637629
fn default() -> Self {
638630
Self::new()

src/md/trajectory/traj_it.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ use crate::time::TimeSeries;
2323

2424
pub struct TrajIterator<'a, S: Interpolatable>
2525
where
26-
DefaultAllocator:
27-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
26+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
2827
{
2928
pub time_series: TimeSeries,
3029
/// A shared pointer to the original trajectory.
@@ -33,8 +32,7 @@ where
3332

3433
impl<S: Interpolatable> Iterator for TrajIterator<'_, S>
3534
where
36-
DefaultAllocator:
37-
Allocator< S::VecLength> + Allocator< S::Size> + Allocator< S::Size, S::Size>,
35+
DefaultAllocator: Allocator<S::VecLength> + Allocator<S::Size> + Allocator<S::Size, S::Size>,
3836
{
3937
type Item = S;
4038

src/od/estimate/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ pub use sc_uncertainty::SpacecraftUncertainty;
3636
pub trait Estimate<T: State>
3737
where
3838
Self: Clone + PartialEq + Sized + fmt::Display,
39-
DefaultAllocator: Allocator< <T as State>::Size>
40-
+ Allocator< <T as State>::Size, <T as State>::Size>
41-
+ Allocator< <T as State>::VecLength>,
39+
DefaultAllocator: Allocator<<T as State>::Size>
40+
+ Allocator<<T as State>::Size, <T as State>::Size>
41+
+ Allocator<<T as State>::VecLength>,
4242
{
4343
/// An empty estimate. This is useful if wanting to store an estimate outside the scope of a filtering loop.
4444
fn zeros(state: T) -> Self;
@@ -93,9 +93,9 @@ where
9393
pub trait NavSolution<T>: Estimate<Spacecraft>
9494
where
9595
T: State,
96-
DefaultAllocator: Allocator< <T as State>::Size>
97-
+ Allocator< <T as State>::Size, <T as State>::Size>
98-
+ Allocator< <T as State>::VecLength>,
96+
DefaultAllocator: Allocator<<T as State>::Size>
97+
+ Allocator<<T as State>::Size, <T as State>::Size>
98+
+ Allocator<<T as State>::VecLength>,
9999
{
100100
fn orbital_state(&self) -> Orbit;
101101
/// Returns the nominal state as computed by the dynamics

src/od/filter/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ where
3434
A: DimName,
3535
M: DimName,
3636
T: State,
37-
DefaultAllocator: Allocator< M>
38-
+ Allocator< <T as State>::Size>
39-
+ Allocator< <T as State>::VecLength>
40-
+ Allocator< A>
41-
+ Allocator< M, M>
42-
+ Allocator< M, <T as State>::Size>
43-
+ Allocator< <T as State>::Size, <T as State>::Size>
44-
+ Allocator< A, A>
45-
+ Allocator< <T as State>::Size, A>
46-
+ Allocator< A, <T as State>::Size>,
37+
DefaultAllocator: Allocator<M>
38+
+ Allocator<<T as State>::Size>
39+
+ Allocator<<T as State>::VecLength>
40+
+ Allocator<A>
41+
+ Allocator<M, M>
42+
+ Allocator<M, <T as State>::Size>
43+
+ Allocator<<T as State>::Size, <T as State>::Size>
44+
+ Allocator<A, A>
45+
+ Allocator<<T as State>::Size, A>
46+
+ Allocator<A, <T as State>::Size>,
4747
{
4848
type Estimate: Estimate<T>;
4949

src/od/msr/arc.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use parquet::arrow::ArrowWriter;
4545
pub struct TrackingArc<Msr>
4646
where
4747
Msr: Measurement,
48-
DefaultAllocator: Allocator< Msr::MeasurementSize>,
48+
DefaultAllocator: Allocator<Msr::MeasurementSize>,
4949
{
5050
/// The YAML configuration to set up these devices
5151
pub device_cfg: String,
@@ -56,8 +56,8 @@ where
5656
impl<Msr> Display for TrackingArc<Msr>
5757
where
5858
Msr: Measurement,
59-
DefaultAllocator: Allocator< Msr::MeasurementSize>
60-
+ Allocator< Msr::MeasurementSize, Msr::MeasurementSize>,
59+
DefaultAllocator:
60+
Allocator<Msr::MeasurementSize> + Allocator<Msr::MeasurementSize, Msr::MeasurementSize>,
6161
{
6262
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6363
write!(
@@ -72,8 +72,8 @@ where
7272
impl<Msr> TrackingArc<Msr>
7373
where
7474
Msr: Measurement,
75-
DefaultAllocator: Allocator< Msr::MeasurementSize>
76-
+ Allocator< Msr::MeasurementSize, Msr::MeasurementSize>,
75+
DefaultAllocator:
76+
Allocator<Msr::MeasurementSize> + Allocator<Msr::MeasurementSize, Msr::MeasurementSize>,
7777
{
7878
/// Store this tracking arc to a parquet file.
7979
pub fn to_parquet_simple<P: AsRef<Path> + Debug>(
@@ -223,9 +223,9 @@ where
223223
where
224224
MsrIn: Interpolatable,
225225
D: TrackingDeviceSim<MsrIn, Msr>,
226-
DefaultAllocator: Allocator< <MsrIn as State>::Size>
227-
+ Allocator< <MsrIn as State>::Size, <MsrIn as State>::Size>
228-
+ Allocator< <MsrIn as State>::VecLength>,
226+
DefaultAllocator: Allocator<<MsrIn as State>::Size>
227+
+ Allocator<<MsrIn as State>::Size, <MsrIn as State>::Size>
228+
+ Allocator<<MsrIn as State>::VecLength>,
229229
{
230230
let devices = D::loads_named(&self.device_cfg)?;
231231

@@ -286,9 +286,9 @@ where
286286
where
287287
MsrIn: Interpolatable,
288288
D: TrackingDeviceSim<MsrIn, Msr>,
289-
DefaultAllocator: Allocator< <MsrIn as State>::Size>
290-
+ Allocator< <MsrIn as State>::Size, <MsrIn as State>::Size>
291-
+ Allocator< <MsrIn as State>::VecLength>,
289+
DefaultAllocator: Allocator<<MsrIn as State>::Size>
290+
+ Allocator<<MsrIn as State>::Size, <MsrIn as State>::Size>
291+
+ Allocator<<MsrIn as State>::VecLength>,
292292
{
293293
let mut devices_map = BTreeMap::new();
294294
let mut sampling_rates_ns = Vec::with_capacity(devices.len());

src/od/msr/range_doppler.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ impl EstimateFrom<Spacecraft, RangeDoppler> for Spacecraft {
150150
transmitter: Orbit,
151151
) -> OMatrix<f64, <RangeDoppler as Measurement>::MeasurementSize, Self::Size>
152152
where
153-
DefaultAllocator:
154-
Allocator< <RangeDoppler as Measurement>::MeasurementSize, Self::Size>,
153+
DefaultAllocator: Allocator<<RangeDoppler as Measurement>::MeasurementSize, Self::Size>,
155154
{
156155
let delta_r = receiver.orbit.radius_km - transmitter.radius_km;
157156
let delta_v = receiver.orbit.velocity_km_s - transmitter.velocity_km_s;

0 commit comments

Comments
 (0)