Skip to content

Commit 991442e

Browse files
committed
Apply rustfmt suggestions
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
1 parent d67cc1b commit 991442e

4 files changed

Lines changed: 5 additions & 12 deletions

File tree

src/client/test_utils.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,8 @@ impl MicrogridApiClient for MockMicrogridApiClient {
375375
// is timestamped at `anchor + dur`, matching the
376376
// resampler's first interval boundary.
377377
let wall = clock.wall_now() + offset;
378-
let sys_delta = wall.signed_duration_since(
379-
chrono::DateTime::<chrono::Utc>::UNIX_EPOCH,
380-
);
378+
let sys_delta =
379+
wall.signed_duration_since(chrono::DateTime::<chrono::Utc>::UNIX_EPOCH);
381380
let next_ts = SystemTime::UNIX_EPOCH
382381
+ std::time::Duration::from_nanos(
383382
sys_delta.num_nanoseconds().unwrap_or(0).max(0) as u64,

src/logical_meter/logical_meter_actor.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,7 @@ impl<C: Clock> LogicalMeterActor<C> {
505505
let mut resampled_metrics: HashMap<Metric, HashMap<u64, Option<f32>>> = HashMap::new();
506506

507507
for (_, resampler) in resamplers.iter_mut() {
508-
while let Some(data) =
509-
poll_telemetry(&mut resampler.receiver, resampler.component_id)
510-
{
508+
while let Some(data) = poll_telemetry(&mut resampler.receiver, resampler.component_id) {
511509
self.push_to_resampler(resampler, data, resampler.metric);
512510
}
513511
let resampled = resampler.resampler.resample(self.resampler_ts);

src/logical_meter/logical_meter_handle.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ impl LogicalMeterHandle {
5555
Error::component_graph_error(format!("Unable to create a component graph: {e}"))
5656
})?;
5757

58-
let logical_meter =
59-
LogicalMeterActor::try_new(receiver, client, config, clock)?;
58+
let logical_meter = LogicalMeterActor::try_new(receiver, client, config, clock)?;
6059

6160
tokio::task::spawn(async move {
6261
logical_meter.run().await;

src/wall_clock_timer.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ mod tests {
180180
// range, so `num_nanoseconds()` returns None and we fall back to
181181
// the input timestamp unchanged.
182182
let ts = DateTime::from_timestamp(500 * 365 * 86400, 0).unwrap();
183-
assert_eq!(
184-
align_to_epoch(ts, TimeDelta::try_seconds(1).unwrap()),
185-
ts,
186-
);
183+
assert_eq!(align_to_epoch(ts, TimeDelta::try_seconds(1).unwrap()), ts);
187184
}
188185

189186
#[test]

0 commit comments

Comments
 (0)