At the moment the new methods in I2CInterface and SPIInterface don't have any trait bounds, which makes it possible to create instances of these types which don't implement the WriteOnlyCommand trait. This makes the display interface unusable, but doesn't generate an error immediately. Requiring the necessary traits when new is called would generate better compiler errors and make it easier to pinpoint the cause of the error by users.
At the moment the
newmethods inI2CInterfaceandSPIInterfacedon't have any trait bounds, which makes it possible to create instances of these types which don't implement theWriteOnlyCommandtrait. This makes the display interface unusable, but doesn't generate an error immediately. Requiring the necessary traits whennewis called would generate better compiler errors and make it easier to pinpoint the cause of the error by users.