formattable trait

This commit is contained in:
Robin Appelman 2026-06-27 00:13:40 +02:00
commit e13243f9a5
6 changed files with 36 additions and 18 deletions

View file

@ -1,6 +1,6 @@
use jzon::JsonValue;
use crate::device::BDAddr;
use crate::device::{BDAddr, FormattableDevice};
use std::{
fmt::{self, Debug, Display},
time::Instant,
@ -48,8 +48,10 @@ impl MiTempDevice {
self.dew_point = dew_point;
}
}
}
pub fn format_open_metrics(&self) -> impl Display + '_ {
impl FormattableDevice for MiTempDevice {
fn format_open_metrics(&self) -> impl Display + '_ {
MitempFormatter { device: self }
}
}