Skip to content

Commit c311025

Browse files
committed
chore: run clippy in the formatting CI workflow
1 parent 6890c29 commit c311025

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

.github/workflows/cli-release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
paths:
1111
- "impit-cli/**"
1212
- "impit/**"
13+
workflow_dispatch:
1314

1415
env:
1516
CRATE_NAME: impit-cli

.github/workflows/format.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
fmt:
10-
name: Check code formatting
10+
name: rustfmt
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
@@ -17,4 +17,18 @@ jobs:
1717
components: rustfmt
1818

1919
- name: Rustfmt Check
20-
uses: actions-rust-lang/rustfmt@v1
20+
uses: actions-rust-lang/rustfmt@v1
21+
clippy:
22+
name: clippy
23+
runs-on: ubuntu-latest
24+
env:
25+
RUSTFLAGS: "--cfg reqwest_unstable"
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: actions-rust-lang/setup-rust-toolchain@v1
30+
with:
31+
components: clippy
32+
33+
- name: Run clippy
34+
run: cargo clippy --all --manifest-path=./Cargo.toml -- -D warnings

impit-cli/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ edition = "2021"
99
clap = { version = "4.5.21", features = ["derive"] }
1010
impit = { path="../impit" }
1111
tokio = { version="1.41.1", features = ["full"] }
12-
aws-lc-rs = { version = "1.11.1", features = ["bindgen"] }
12+
aws-lc-rs = { version = "1.11.1" }
1313

1414
[target.x86_64-unknown-linux-musl.dependencies]
1515
openssl = { version = "*", features = ["vendored"] }
16+
aws-lc-rs = { version = "1.11.1" features = ["bindgen"] }
1617

1718
[target.aarch64-unknown-linux-musl.dependencies]
1819
openssl = { version = "*", features = ["vendored"] }
20+
aws-lc-rs = { version = "1.11.1" features = ["bindgen"] }
1921

2022
[target.arm-unknown-linux-musleabi.dependencies]
2123
openssl = { version = "*", features = ["vendored"] }
24+
aws-lc-rs = { version = "1.11.1" features = ["bindgen"] }

impit/src/response_parsing/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use encoding::Encoding;
44
/// If the BOM sniffing algorithm fails, the function returns `None`.
55
///
66
/// See more details at https://encoding.spec.whatwg.org/#bom-sniff
7-
fn bom_sniffing(bytes: &Vec<u8>) -> Option<encoding::EncodingRef> {
7+
fn bom_sniffing(bytes: &[u8]) -> Option<encoding::EncodingRef> {
88
if bytes.len() < 3 {
99
return None;
1010
}
@@ -27,7 +27,7 @@ fn bom_sniffing(bytes: &Vec<u8>) -> Option<encoding::EncodingRef> {
2727
/// A lazy implementation of the BOM sniffing algorithm, using `scraper` to parse the HTML and extract the encoding.
2828
///
2929
/// See more details at https://html.spec.whatwg.org/#prescan-a-byte-stream-to-determine-its-encoding
30-
fn prescan_bytestream(bytes: &Vec<u8>) -> Option<encoding::EncodingRef> {
30+
fn prescan_bytestream(bytes: &[u8]) -> Option<encoding::EncodingRef> {
3131
if bytes.len() < 4 {
3232
return None;
3333
}

0 commit comments

Comments
 (0)