rust-embedded / embedded-hal

A Hardware Abstraction Layer (HAL) for embedded systems
Apache License 2.0
1.95k stars 197 forks source link

TryInto instead of Into #307

Open burrbull opened 3 years ago

burrbull commented 3 years ago

https://github.com/rust-embedded/embedded-hal/blob/3dcb672bfcff83d8e672ae41cd203a9c6a9c8b4c/src/nb/timer.rs#L69

During moving to embedded-time I found Into<Hertz> is not implemented for Kilo/Megahertz

ryankurte commented 3 years ago

hey thanks for the issue, where is the Hertz type from? i might not have the full picture but, it seems like that'd be a missing conversion in embedded-time (or the HAL you're using) rather than here, and that a compiler error is better than a runtime one for this situation?