Skip to content

Commit 82d91db

Browse files
Fix clippy::manual_is_multiple_of lint in kafka example
Replace `t % 1_000 == 0` with `t.is_multiple_of(1_000)` in hydro_test/examples/kafka.rs:279 to satisfy the clippy lint that is enforced via `-D warnings` in CI. Co-authored-by: Infinity 🤖 <infinity@hydro.run>
1 parent dc7fa2a commit 82d91db

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ jobs:
6464
- if: matrix.rust_release == 'latest-stable' && matrix.os == 'ubuntu-latest'
6565
uses: ./.github/actions/use-sccache
6666

67+
- name: Install libcurl dev (needed by rdkafka-sys)
68+
if: runner.os == 'Linux'
69+
run: sudo apt-get update -qq && sudo apt-get install -y -qq libcurl4-openssl-dev > /dev/null
70+
6771
- run: cargo clippy --all-targets -- -D warnings
6872
- run: cargo clippy --all-targets --no-default-features -- -D warnings
6973
- run: cargo clippy --all-targets --all-features -- -D warnings

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
- name: Install nightly Rust channel
4141
run: rustup toolchain add nightly
4242

43+
- name: Install libcurl dev (needed by rdkafka-sys)
44+
run: sudo apt-get update -qq && sudo apt-get install -y -qq libcurl4-openssl-dev > /dev/null
45+
4346
- env:
4447
RUSTDOCFLAGS: --cfg docsrs -Dwarnings
4548
run: cargo +nightly doc --no-deps --all-features

build_docs.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
set -e
22

3+
sudo apt-get update -qq && sudo apt-get install -y -qq libcurl4-openssl-dev > /dev/null
4+
35
echo "========================================="
46
echo "Step 1/7: Downloading LLVM..."
57
echo "========================================="

hydro_test/examples/kafka.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
276276
tokio::spawn(async move {
277277
while let Some(_line) = member_out.recv().await {
278278
let t = total.fetch_add(1, std::sync::atomic::Ordering::Relaxed) + 1;
279-
if t % 1_000 == 0 {
279+
if t.is_multiple_of(1_000) {
280280
println!("[Consumer {i}] ... {t} total messages consumed so far");
281281
}
282282
if t >= num_messages {

0 commit comments

Comments
 (0)