Skip to content

Commit

Permalink
Change method name to better reflect its purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
Dániel Buga authored and bugadani committed Jun 8, 2020
1 parent fdead05 commit 3a84fce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/noise_i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn main() -> ! {
let mut disp: GraphicsMode<_> = Builder::new().connect(interface).into();
disp.init().unwrap();

let mut props = disp.properties();
let mut props = disp.into_properties();

let mut buf = [0x00u8; 1024];

Expand Down
6 changes: 3 additions & 3 deletions src/mode/displaymode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ pub trait DisplayModeTrait<DI>: Sized {
fn new(properties: DisplayProperties<DI>) -> Self;

/// Deconstruct object and retrieve DisplayProperties
fn properties(self) -> DisplayProperties<DI>;
fn into_properties(self) -> DisplayProperties<DI>;

/// Release display interface
fn release(self) -> DI {
self.properties().release()
self.into_properties().release()
}
}

Expand All @@ -33,7 +33,7 @@ impl<MODE> DisplayMode<MODE> {
DI: WriteOnlyDataCommand,
MODE: DisplayModeTrait<DI>,
{
let properties = self.0.properties();
let properties = self.0.into_properties();
NMODE::new(properties)
}
}
2 changes: 1 addition & 1 deletion src/mode/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl<DI> DisplayModeTrait<DI> for GraphicsMode<DI> {
}

/// Release display interface used by TerminalMode
fn properties(self) -> DisplayProperties<DI> {
fn into_properties(self) -> DisplayProperties<DI> {
self.properties
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/mode/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ where
}

/// Release display interface used by TerminalMode
fn properties(self) -> DisplayProperties<DI> {
fn into_properties(self) -> DisplayProperties<DI> {
self.properties
}
}
Expand Down

0 comments on commit 3a84fce

Please sign in to comment.