diff --git a/hello_display/rustfmt.toml b/hello_display/rustfmt.toml new file mode 100644 index 0000000..df99c69 --- /dev/null +++ b/hello_display/rustfmt.toml @@ -0,0 +1 @@ +max_width = 80 diff --git a/hello_display/src/main.rs b/hello_display/src/main.rs index a0f234c..0653c59 100644 --- a/hello_display/src/main.rs +++ b/hello_display/src/main.rs @@ -1,21 +1,17 @@ +use airportdisplay::{text::Text, Command, Display}; use anyhow::Result; -use airportdisplay::{ - Command, - Display, - text::Text, - text::Buffer, -}; fn main() -> Result<()> { println!("Sending hello display..."); let display = Display::open("172.23.42.29:2342".into())?; - let text = Command::Text(Text::Buffer( - Buffer::from( - "♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n♥ mauuu ♥\n♥ mau mauuuunz! ♥\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥".to_string()))); + let text: String = + "♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n♥ mauuu ♥\n♥ mau mauuuunz! ♥\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥".into(); + + println!("{}", text); display.send(Command::Clear)?; - display.send(text)?; + display.send(Command::Text(Text::Buffer(text.into())))?; Ok(()) }