From 005bc6d2973ec01d451ff2c38787547cebcf99ee Mon Sep 17 00:00:00 2001 From: Annika Hannig Date: Sat, 27 Aug 2022 12:02:42 +0000 Subject: [PATCH] updated hello display example --- hello_display/Cargo.lock | 8 -------- hello_display/src/main.rs | 8 ++++---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/hello_display/Cargo.lock b/hello_display/Cargo.lock index cefe8dd..1d68e24 100644 --- a/hello_display/Cargo.lock +++ b/hello_display/Cargo.lock @@ -6,8 +6,6 @@ version = 3 name = "airportdisplay" version = "0.1.0" dependencies = [ - "anyhow", - "bytes", "codepage-437", ] @@ -29,12 +27,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bytes" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" - [[package]] name = "codepage-437" version = "0.1.0" diff --git a/hello_display/src/main.rs b/hello_display/src/main.rs index f4242c7..a0f234c 100644 --- a/hello_display/src/main.rs +++ b/hello_display/src/main.rs @@ -2,8 +2,8 @@ use anyhow::Result; use airportdisplay::{ Command, Display, - Text, - TextBuffer, + text::Text, + text::Buffer, }; fn main() -> Result<()> { @@ -11,8 +11,8 @@ fn main() -> Result<()> { let display = Display::open("172.23.42.29:2342".into())?; let text = Command::Text(Text::Buffer( - TextBuffer::from( - "♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n♥ mauuu ♥\n♥ mau mauuuunz! ♥\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥".into()))); + Buffer::from( + "♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n♥ mauuu ♥\n♥ mau mauuuunz! ♥\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥".to_string()))); display.send(Command::Clear)?; display.send(text)?;