KurtisDinelle[m]: > <@kurtjd:matrix.org> Hey everyone, pretty new to Rust in general but I'm working on an embedded-hal driver for an I2C device. I want my driver to support both async and regular blocking I2C calls. The only difference is that the blocking version doesn't use .await after I2C calls or declare its functions async. > > Currently I use the duplicate crate to create two copies of the driver implementation (so I didn't have to manually maintain two very slightly different copies) as seen here: https://github.com/kurtjd/tsl2591-rs/blob/main/src/lib.rs#L161 > > But I'm wondering if there is a better, "proper" way to handle this. Haven't been able to find any drivers that try to do this as an example, so not too sure. Any advice appreciated! Huh, I've not seen this duplicate crate before