Skip to content

Commit a1c116d

Browse files
authored
Explicitly return the type instead of returning an impl trait (#132)
The type system fails to auto-coerce it to the right type and it's also not necessary since we know quite well what the function will return. Closes #131 Signed-off-by: Daniel Egger <[email protected]>
1 parent 4d97c1e commit a1c116d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/builder.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ impl I2CDIBuilder {
160160
/// Finish the builder and return an initialised display interface for further use
161161
///
162162
/// This method consumes the builder and must come last in the method call chain
163-
pub fn init<I: hal::blocking::i2c::Write>(self, i2c: I) -> impl WriteOnlyDataCommand {
163+
pub fn init<I: hal::blocking::i2c::Write>(
164+
self,
165+
i2c: I,
166+
) -> display_interface_i2c::I2CInterface<I> {
164167
display_interface_i2c::I2CInterface::new(i2c, self.i2c_addr, 0x40)
165168
}
166169
}

0 commit comments

Comments
 (0)