#[derive(PartialEq, Debug, Clone, Eq, Hash)]
pub struct SensorId {
pub(crate) name: String,
}
pub fn sensor(name: &str) -> SensorId {
SensorId::new(name.to_string())
}
impl SensorId {
pub fn new(name: String) -> Self {
Self { name }
}
}
#[cfg(test)]
mod tests {
use crate::sensor_id::SensorId;
#[test]
fn test_new() {
let sensor_id = SensorId::new("foo".to_string());
assert_eq!(sensor_id.name, "foo".to_string())
}
}