Compare commits

..

4 commits

Author SHA1 Message Date
Vinzenz Schroeter
569a4b13af more feature-agnostic examples
Some checks failed
Rust / build (pull_request) Failing after 1m13s
2025-02-17 21:32:40 +01:00
Vinzenz Schroeter
1740c41fca format code 2025-02-17 21:32:40 +01:00
Vinzenz Schroeter
6135d5e9d9 move all of cp437 feature code into one unit 2025-02-17 21:32:40 +01:00
Vinzenz Schroeter
368a7f2984 CI check --no-default-features works 2025-02-17 21:32:40 +01:00
5 changed files with 12 additions and 12 deletions

View file

@ -30,8 +30,8 @@ jobs:
- name: Run Clippy - name: Run Clippy
run: cargo clippy --all-targets --all-features run: cargo clippy --all-targets --all-features
- name: no features -- test - name: no features -- test (without doctest)
run: cargo test --all --no-default-features run: cargo test --all-targets --no-default-features
- name: default features -- test - name: default features -- test
run: cargo test --all run: cargo test --all
@ -41,4 +41,4 @@ jobs:
- name: all features -- test - name: all features -- test
run: cargo test --all --all-features run: cargo test --all --all-features
- name: all features -- examples - name: all features -- examples
run: cargo build --all-features --examples run: cargo build --examples --all-features

View file

@ -14,7 +14,7 @@ use rand::{
/// let val: u8 = b.into(); /// let val: u8 = b.into();
/// ///
/// let b = Brightness::try_from(7).unwrap(); /// let b = Brightness::try_from(7).unwrap();
/// # let connection = Connection::open("127.0.0.1:2342").unwrap(); /// # let connection = Connection::Fake;
/// let result = connection.send(Command::Brightness(b)); /// let result = connection.send(Command::Brightness(b));
/// ``` /// ```
#[derive(Debug, Copy, Clone, PartialEq, Eq, Ord, PartialOrd)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Ord, PartialOrd)]

View file

@ -13,7 +13,7 @@ use crate::ByteGrid;
/// grid.set(0, 0, Brightness::MIN); /// grid.set(0, 0, Brightness::MIN);
/// grid.set(1, 1, Brightness::MIN); /// grid.set(1, 1, Brightness::MIN);
/// ///
/// # let connection = Connection::open("127.0.0.1:2342").unwrap(); /// # let connection = Connection::Fake;
/// connection.send(Command::CharBrightness(Origin::new(3, 7), grid)).unwrap() /// connection.send(Command::CharBrightness(Origin::new(3, 7), grid)).unwrap()
/// ``` /// ```
pub type BrightnessGrid = ValueGrid<Brightness>; pub type BrightnessGrid = ValueGrid<Brightness>;

View file

@ -52,7 +52,7 @@ pub type Offset = usize;
/// assert_eq!(command, round_tripped); /// assert_eq!(command, round_tripped);
/// ///
/// // send command /// // send command
/// # let connection = Connection::open("127.0.0.1:2342").unwrap(); /// # let connection = Connection::Fake;
/// connection.send(command).unwrap(); /// connection.send(command).unwrap();
/// ``` /// ```
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
@ -63,7 +63,7 @@ pub enum Command {
/// ///
/// ```rust /// ```rust
/// # use servicepoint::{Command, Connection}; /// # use servicepoint::{Command, Connection};
/// # let connection = Connection::open("127.0.0.1:2342").unwrap(); /// # let connection = Connection::Fake;
/// connection.send(Command::Clear).unwrap(); /// connection.send(Command::Clear).unwrap();
/// ``` /// ```
Clear, Clear,
@ -138,7 +138,7 @@ pub enum Command {
/// ///
/// ```rust /// ```rust
/// # use servicepoint::{Brightness, Command, Connection}; /// # use servicepoint::{Brightness, Command, Connection};
/// # let connection = Connection::open("127.0.0.1:2342").unwrap(); /// # let connection = Connection::Fake;
/// let command = Command::Brightness(Brightness::MAX); /// let command = Command::Brightness(Brightness::MAX);
/// connection.send(command).unwrap(); /// connection.send(command).unwrap();
/// ``` /// ```
@ -187,7 +187,7 @@ pub enum Command {
/// ///
/// ```rust /// ```rust
/// # use servicepoint::{Command, Connection}; /// # use servicepoint::{Command, Connection};
/// # let connection = Connection::open("127.0.0.1:2342").unwrap(); /// # let connection = Connection::Fake;
/// connection.send(Command::HardReset).unwrap(); /// connection.send(Command::HardReset).unwrap();
/// ``` /// ```
HardReset, HardReset,
@ -200,7 +200,7 @@ pub enum Command {
/// ///
/// ```rust /// ```rust
/// # use servicepoint::{Command, Connection}; /// # use servicepoint::{Command, Connection};
/// # let connection = Connection::open("127.0.0.1:2342").unwrap(); /// # let connection = Connection::Fake;
/// connection.send(Command::FadeOut).unwrap(); /// connection.send(Command::FadeOut).unwrap();
/// ``` /// ```
FadeOut, FadeOut,
@ -213,7 +213,7 @@ pub enum Command {
/// ///
/// ```rust /// ```rust
/// # use servicepoint::{Command, Connection}; /// # use servicepoint::{Command, Connection};
/// # let connection = Connection::open("127.0.0.1:2342").unwrap(); /// # let connection = Connection::Fake;
/// // this sends a packet that does nothing /// // this sends a packet that does nothing
/// # #[allow(deprecated)] /// # #[allow(deprecated)]
/// connection.send(Command::BitmapLegacy).unwrap(); /// connection.send(Command::BitmapLegacy).unwrap();

View file

@ -63,7 +63,7 @@ pub const PIXEL_COUNT: usize = PIXEL_WIDTH * PIXEL_HEIGHT;
/// connection.send(Command::BitmapLinearWin( /// connection.send(Command::BitmapLinearWin(
/// Origin::new(0,0), /// Origin::new(0,0),
/// pixels, /// pixels,
/// CompressionCode::Lzma /// CompressionCode::Uncompressed
/// )) /// ))
/// .expect("send failed"); /// .expect("send failed");
/// ///