Skip to content

Commit ee24c1f

Browse files
committed
Fix and linting
Signed-off-by: Marvin Hansen <[email protected]>
1 parent 9b3d7c3 commit ee24c1f

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

deep_causality/src/utils_test/test_utils_generator.rs

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* SPDX-License-Identifier: MIT
33
* Copyright (c) "2025" . The DeepCausality Authors and Contributors. All Rights Reserved.
44
*/
5-
use std::hash::Hash;
65
use crate::*;
6+
use std::hash::Hash;
77

88
// A mock data structure used across multiple tests.
99
#[derive(Debug, Clone, Eq, Hash, Copy, PartialEq, Default)]
@@ -69,7 +69,6 @@ pub type TestModel = Model<
6969
FloatType,
7070
>;
7171

72-
7372
// A test processor to act as a destination for the generative output.
7473
pub struct TestProcessor<D, S, T, ST, SYM, VS, VT>
7574
where
@@ -85,6 +84,21 @@ where
8584
pub context_dest: Option<Context<D, S, T, ST, SYM, VS, VT>>,
8685
}
8786

87+
impl<D, S, T, ST, SYM, VS, VT> Default for TestProcessor<D, S, T, ST, SYM, VS, VT>
88+
where
89+
D: Default + Datable + Copy + Clone + Hash + Eq + PartialEq,
90+
S: Spatial<VS> + Clone,
91+
T: Temporal<VT> + Clone,
92+
ST: SpaceTemporal<VS, VT> + Clone,
93+
SYM: Symbolic + Clone,
94+
VS: Clone,
95+
VT: Clone,
96+
{
97+
fn default() -> Self {
98+
Self::new()
99+
}
100+
}
101+
88102
impl<D, S, T, ST, SYM, VS, VT> TestProcessor<D, S, T, ST, SYM, VS, VT>
89103
where
90104
D: Default + Datable + Copy + Clone + Hash + Eq + PartialEq,
@@ -105,7 +119,7 @@ where
105119

106120
// Implement the processor trait so it can be used to test generators.
107121
impl<D, S, T, ST, SYM, VS, VT, G> GenerativeProcessor<D, S, T, ST, SYM, VS, VT, G>
108-
for TestProcessor<D, S, T, ST, SYM, VS, VT>
122+
for TestProcessor<D, S, T, ST, SYM, VS, VT>
109123
where
110124
D: Default + Datable + Copy + Clone + Hash + Eq + PartialEq,
111125
S: Spatial<VS> + Clone,
@@ -139,16 +153,16 @@ pub type TestProcessorAlias = TestProcessor<
139153
// Define a dummy generator for testing standalone outputs.
140154
pub struct DummyGenerator;
141155
impl
142-
Generatable<
143-
MockData,
144-
EuclideanSpace,
145-
EuclideanTime,
146-
EuclideanSpacetime,
147-
BaseSymbol,
148-
FloatType,
149-
FloatType,
150-
DummyGenerator,
151-
> for DummyGenerator
156+
Generatable<
157+
MockData,
158+
EuclideanSpace,
159+
EuclideanTime,
160+
EuclideanSpacetime,
161+
BaseSymbol,
162+
FloatType,
163+
FloatType,
164+
DummyGenerator,
165+
> for DummyGenerator
152166
{
153167
fn generate(
154168
&mut self,

0 commit comments

Comments
 (0)