Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Commit 55183c4

Browse files
committed
feat: add utility function to shorten sensor creation
1 parent c9b06e5 commit 55183c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/sensor_id.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ pub mod sensor_id {
88
pub struct SensorId {
99
pub(crate) name: String,
1010
}
11+
12+
pub fn sensor(name: &str) -> SensorId {
13+
SensorId::new(name.to_string())
14+
}
1115
}
1216

1317
impl SensorId {

0 commit comments

Comments
 (0)