only require into Packet for sendable data

This commit is contained in:
Annika Hannig 2024-05-23 20:56:46 +02:00
parent 0bc13fee81
commit e9dc4b59d2
No known key found for this signature in database
GPG key ID: 62E226E47DDCE58D
6 changed files with 11 additions and 11 deletions

View file

@ -21,7 +21,7 @@ fn main() {
let connection = Connection::open(&cli.destination).unwrap();
if cli.clear {
connection.send(Command::Clear.into()).unwrap();
connection.send(Command::Clear).unwrap();
}
let max_width = cli.text.iter().map(|t| t.len()).max().unwrap();
@ -37,6 +37,6 @@ fn main() {
}
connection
.send(Command::Cp437Data(Origin(0, 0), chars).into())
.send(Command::Cp437Data(Origin(0, 0), chars))
.unwrap();
}

View file

@ -28,7 +28,6 @@ fn main() {
field.clone(),
CompressionCode::Lzma,
)
.into(),
)
.expect("could not send");
thread::sleep(FRAME_PACING);

View file

@ -29,7 +29,6 @@ fn main() {
pixels.clone(),
CompressionCode::Lzma,
)
.into(),
)
.unwrap();
thread::sleep(FRAME_PACING);

View file

@ -30,12 +30,12 @@ fn main() {
let command =
BitmapLinearWin(Origin(0, 0), filled_grid, CompressionCode::Lzma);
connection.send(command.into()).expect("send failed");
connection.send(command).expect("send failed");
}
// set all pixels to the same random brightness
let mut rng = rand::thread_rng();
connection.send(Brightness(rng.gen()).into()).unwrap();
connection.send(Brightness(rng.gen())).unwrap();
// continuously update random windows to new random brightness
loop {
@ -56,7 +56,7 @@ fn main() {
}
connection
.send(CharBrightness(origin, luma).into())
.send(CharBrightness(origin, luma))
.unwrap();
std::thread::sleep(wait_duration);
}

View file

@ -39,7 +39,6 @@ fn main() {
connection
.send(
Command::BitmapLinearAnd(0, bit_vec, CompressionCode::Lzma)
.into(),
)
.unwrap();
thread::sleep(sleep_duration);