Skip to content

Commit d379107

Browse files
committed
ui: display: prevent mismatched_lifetime_syntaxes compile warning
The missing lifetime annotation results in the build showing a warning when compiled using the nightly toolchain: > error: lifetime flowing from input to output with different syntax can be confusing > --> src/ui/display.rs:147:19 > | > 147 | pub fn rotate(&mut self) -> DisplayRotated { > | ^^^^^^^^^ -------------- the lifetime gets resolved as `'_` > | | > | this lifetime flows to the output > | > = note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings` > = help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]` > help: one option is to remove the lifetime for references and use the anonymous lifetime for paths > | > 147 | pub fn rotate(&mut self) -> DisplayRotated<'_> { > | ++++ Fix that by adding the suggested annotation. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
1 parent b2c0e9f commit d379107

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ui/display.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl DisplayExclusive {
144144
///
145145
/// Drawing a pixel to the bottom of DisplayRotated results in the pixel
146146
/// appearing on the right of the actual screen.
147-
pub fn rotate(&mut self) -> DisplayRotated {
147+
pub fn rotate(&mut self) -> DisplayRotated<'_> {
148148
// This could easily be made more generic, by accepting a direction
149149
// parameter, but that would result in dead code because we only
150150
// draw the button legend rotated.

0 commit comments

Comments
 (0)