diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0480ccf..fbf93a9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,27 +9,37 @@ on: env: CARGO_TERM_COLOR: always + # Make sure CI fails on all warnings, including Clippy lints + RUSTFLAGS: "-Dwarnings" + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: install lzma - run: sudo apt-get update && sudo apt-get install -y liblzma-dev + - name: Update repos + run: sudo apt-get update -qq + - name: Install rust toolchain + run: sudo apt-get install -qy cargo rust-clippy + - name: install lzma + run: sudo apt-get update && sudo apt-get install -y liblzma-dev - - name: build default features - run: cargo build --all --verbose - - name: build default features -- examples - run: cargo build --examples --verbose - - name: test default features - run: cargo test --all --verbose + - name: Run Clippy + run: cargo clippy --all-targets --all-features + + - name: build default features + run: cargo build --all --verbose + - name: build default features -- examples + run: cargo build --examples --verbose + - name: test default features + run: cargo test --all --verbose - - name: build all features - run: cargo build --all-features --verbose - - name: build all features -- examples - run: cargo build --all-features --examples --verbose - - name: test all features - run: cargo test --all --all-features --verbose + - name: build all features + run: cargo build --all-features --verbose + - name: build all features -- examples + run: cargo build --all-features --examples --verbose + - name: test all features + run: cargo test --all --all-features --verbose diff --git a/README.md b/README.md index 65c2a76..c02b28e 100644 --- a/README.md +++ b/README.md @@ -3,20 +3,22 @@ [![crates.io](https://img.shields.io/crates/v/servicepoint.svg)](https://crates.io/crates/servicepoint) [![Crates.io Total Downloads](https://img.shields.io/crates/d/servicepoint)](https://crates.io/crates/servicepoint) [![docs.rs](https://img.shields.io/docsrs/servicepoint)](https://docs.rs/servicepoint/latest/servicepoint/) -[![GPLv3 licensed](https://img.shields.io/crates/l/servicepoint)](../../LICENSE) +[![GPLv3 licensed](https://img.shields.io/crates/l/servicepoint)](./LICENSE) In [CCCB](https://berlin.ccc.de/), there is a big pixel matrix hanging on the wall. It is called "Service Point Display" or "Airport Display". This repository contains a library for parsing, encoding and sending packets to this display via UDP in multiple programming languages. +This repository will move to [git.berlin.ccc.de/servicepoint/servicepoint-simulator](https://git.berlin.ccc.de/servicepoint/servicepoint-simulator) soon. + Take a look at the contained crates for language specific information: -| Crate | Languages | Readme | -|-----------------------------|-----------------------------------|-------------------------------------------------------------------------| -| servicepoint | Rust | [servicepoint](crates/servicepoint/README.md) | -| servicepoint_binding_c | C / C++ | [servicepoint_binding_c](crates/servicepoint_binding_c/README.md) | -| servicepoint_binding_uniffi | C# / Python / Go / Kotlin / Swift | [servicepoint_binding_cs](crates/servicepoint_binding_uniffi/README.md) | +| Crate | Languages | Readme | +|-----------------------------|-----------------------------------|-----------------------------------------------------------------------------| +| servicepoint | Rust | [servicepoint](crates/servicepoint/README.md) | +| servicepoint_binding_c | C / C++ | [servicepoint_binding_c](crates/servicepoint_binding_c/README.md) | +| servicepoint_binding_uniffi | C# / Python / Go / Kotlin / Swift | [servicepoint_binding_uniffi](crates/servicepoint_binding_uniffi/README.md) | ## Projects using the library @@ -28,7 +30,7 @@ Take a look at the contained crates for language specific information: - animations that play on the display - tanks game (C#): [servicepoint-tanks](https://github.com/kaesaecracker/cccb-tanks-cs) - cellular automata slideshow (rust): [servicepoint-life](https://github.com/kaesaecracker/servicepoint-life) -- browser stream (typescript): [cccb-servicepoint-browser](https://github.com/SamuelScheit/cccb-servicepoint-browser) +- partial typescript implementation inspired by this library and browser stream: [cccb-servicepoint-browser](https://github.com/SamuelScheit/cccb-servicepoint-browser) To add yourself to the list, open a pull request. diff --git a/crates/servicepoint/src/command.rs b/crates/servicepoint/src/command.rs index 92ea8a9..397ada6 100644 --- a/crates/servicepoint/src/command.rs +++ b/crates/servicepoint/src/command.rs @@ -605,7 +605,7 @@ mod tests { #[test] fn round_trip_bitmap_linear() { - for compression in all_compressions().to_owned() { + for compression in all_compressions().iter().copied() { round_trip(Command::BitmapLinear( 23, BitVec::repeat(false, 40), @@ -750,7 +750,7 @@ mod tests { #[test] fn error_decompression_failed_win() { - for compression in all_compressions().to_owned() { + for compression in all_compressions().iter().copied() { let p: Packet = Command::BitmapLinearWin( Origin::new(16, 8), Bitmap::new(8, 8), @@ -780,7 +780,7 @@ mod tests { #[test] fn error_decompression_failed_and() { - for compression in all_compressions().to_owned() { + for compression in all_compressions().iter().copied() { let p: Packet = Command::BitmapLinearAnd( 0, BitVec::repeat(false, 8), diff --git a/crates/servicepoint/src/cp437.rs b/crates/servicepoint/src/cp437.rs index 32a7396..cb9b945 100644 --- a/crates/servicepoint/src/cp437.rs +++ b/crates/servicepoint/src/cp437.rs @@ -101,7 +101,7 @@ mod tests_feature_cp437 { ⌡"#; let cp437 = Cp437Converter::str_to_cp437(utf8); - let actual = Cp437Converter::cp437_to_str(&*cp437); + let actual = Cp437Converter::cp437_to_str(&cp437); assert_eq!(utf8, actual) }