diff --git a/crates/servicepoint/examples/announce.rs b/crates/servicepoint/examples/announce.rs index bb287b4..af78a54 100644 --- a/crates/servicepoint/examples/announce.rs +++ b/crates/servicepoint/examples/announce.rs @@ -46,6 +46,6 @@ fn main() { let cp437_grid = Cp437Grid::from(&grid); connection - .send(Command::Cp437Data(Origin::new(0, 0), cp437_grid)) + .send(Command::Cp437Data(Origin::ZERO, cp437_grid)) .expect("sending text failed"); } diff --git a/crates/servicepoint/examples/brightness_tester.rs b/crates/servicepoint/examples/brightness_tester.rs index 09e1ed6..8a31ee8 100644 --- a/crates/servicepoint/examples/brightness_tester.rs +++ b/crates/servicepoint/examples/brightness_tester.rs @@ -19,7 +19,7 @@ fn main() { pixels.fill(true); let command = Command::BitmapLinearWin( - Origin::new(0, 0), + Origin::ZERO, pixels, CompressionCode::Uncompressed, ); @@ -33,6 +33,6 @@ fn main() { } connection - .send(Command::CharBrightness(Origin::new(0, 0), brightnesses)) + .send(Command::CharBrightness(Origin::ZERO, brightnesses)) .expect("send failed"); } diff --git a/crates/servicepoint/examples/game_of_life.rs b/crates/servicepoint/examples/game_of_life.rs index 3a72f4e..76e8c70 100644 --- a/crates/servicepoint/examples/game_of_life.rs +++ b/crates/servicepoint/examples/game_of_life.rs @@ -24,7 +24,7 @@ fn main() { loop { let command = Command::BitmapLinearWin( - Origin::new(0, 0), + Origin::ZERO, field.clone(), CompressionCode::Lzma, ); diff --git a/crates/servicepoint/examples/moving_line.rs b/crates/servicepoint/examples/moving_line.rs index 3e55104..50cfcca 100644 --- a/crates/servicepoint/examples/moving_line.rs +++ b/crates/servicepoint/examples/moving_line.rs @@ -25,7 +25,7 @@ fn main() { } let command = Command::BitmapLinearWin( - Origin::new(0, 0), + Origin::ZERO, pixels.clone(), CompressionCode::Lzma, ); diff --git a/crates/servicepoint/examples/random_brightness.rs b/crates/servicepoint/examples/random_brightness.rs index 51ab515..f47cf72 100644 --- a/crates/servicepoint/examples/random_brightness.rs +++ b/crates/servicepoint/examples/random_brightness.rs @@ -32,7 +32,7 @@ fn main() { filled_grid.fill(true); let command = BitmapLinearWin( - Origin::new(0, 0), + Origin::ZERO, filled_grid, CompressionCode::Lzma, ); diff --git a/crates/servicepoint/src/command.rs b/crates/servicepoint/src/command.rs index 51235fd..eead79d 100644 --- a/crates/servicepoint/src/command.rs +++ b/crates/servicepoint/src/command.rs @@ -114,7 +114,7 @@ pub enum Command { /// /// // create command to send pixels /// let command = Command::BitmapLinearWin( - /// servicepoint::Origin::new(0, 0), + /// servicepoint::Origin::ZERO, /// pixels, /// CompressionCode::Uncompressed /// ); @@ -588,7 +588,7 @@ mod tests { compression, )); round_trip(Command::BitmapLinearWin( - Origin::new(0, 0), + Origin::ZERO, Bitmap::max_sized(), compression, )); diff --git a/crates/servicepoint/src/compression_code.rs b/crates/servicepoint/src/compression_code.rs index 25b0daf..d7db7cd 100644 --- a/crates/servicepoint/src/compression_code.rs +++ b/crates/servicepoint/src/compression_code.rs @@ -6,11 +6,11 @@ /// # use servicepoint::{Command, CompressionCode, Origin, Bitmap}; /// // create command without payload compression /// # let pixels = Bitmap::max_sized(); -/// _ = Command::BitmapLinearWin(Origin::new(0, 0), pixels, CompressionCode::Uncompressed); +/// _ = Command::BitmapLinearWin(Origin::ZERO, pixels, CompressionCode::Uncompressed); /// /// // create command with payload compressed with lzma and appropriate header flags /// # let pixels = Bitmap::max_sized(); -/// _ = Command::BitmapLinearWin(Origin::new(0, 0), pixels, CompressionCode::Lzma); +/// _ = Command::BitmapLinearWin(Origin::ZERO, pixels, CompressionCode::Lzma); /// ``` #[repr(u16)] #[derive(Debug, Clone, Copy, PartialEq)] diff --git a/crates/servicepoint/src/lib.rs b/crates/servicepoint/src/lib.rs index 3848967..94ac477 100644 --- a/crates/servicepoint/src/lib.rs +++ b/crates/servicepoint/src/lib.rs @@ -26,7 +26,7 @@ //! //! // create command to send pixels //! let command = Command::BitmapLinearWin( -//! servicepoint::Origin::new(0, 0), +//! servicepoint::Origin::ZERO, //! pixels, //! CompressionCode::Uncompressed //! ); diff --git a/crates/servicepoint/src/origin.rs b/crates/servicepoint/src/origin.rs index 6c0f5d2..345b89e 100644 --- a/crates/servicepoint/src/origin.rs +++ b/crates/servicepoint/src/origin.rs @@ -12,7 +12,7 @@ pub struct Origin { } impl Origin { - /// Top-left. Equivalent to `Origin::new(0, 0)`. + /// Top-left. Equivalent to `Origin::ZERO`. pub const ZERO: Self = Self { x: 0, y: 0,