Skip to content

Commit 96135b2

Browse files
committed
Remove default generic type for Formula and Sample
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
1 parent 98c28e9 commit 96135b2

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/logical_meter/formula.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<F: GraphFormulaProvider, M: Metric> FormulaParams<F, M> {
5656
}
5757

5858
/// A trait that defines generic formula operations.
59-
pub trait Formula<Q: Quantity = f32>: std::fmt::Display + Sized {
59+
pub trait Formula<Q: Quantity>: std::fmt::Display + Sized {
6060
fn coalesce(self, other: Self) -> Result<Self, Error>;
6161
fn min(self, other: Self) -> Result<Self, Error>;
6262
fn max(self, other: Self) -> Result<Self, Error>;

src/logical_meter/logical_meter_actor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct LogicalMeterFormula<Q: Quantity = f32> {
3030
struct ComponentDataResampler {
3131
component_id: u64,
3232
metric: Metric,
33-
resampler: frequenz_resampling::Resampler<f32, Sample>,
33+
resampler: frequenz_resampling::Resampler<f32, Sample<f32>>,
3434
receiver: broadcast::Receiver<ElectricalComponentTelemetry>,
3535
}
3636

src/sample.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use chrono::{DateTime, Utc};
55

66
/// Represents a measurement of a microgrid metric, made at a specific time.
77
#[derive(Clone, Debug, Default)]
8-
pub struct Sample<Q: Copy + Clone + std::fmt::Debug + Default = f32> {
8+
pub struct Sample<Q: Copy + Clone + std::fmt::Debug + Default> {
99
timestamp: DateTime<Utc>,
1010
value: Option<Q>,
1111
}

0 commit comments

Comments
 (0)