Skip to content

Commit 27ce8fb

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

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-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: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ on:
55
- master
66
pull_request:
77

8+
env:
9+
RUSTFLAGS: "--cfg reqwest_unstable"
10+
811
jobs:
912
fmt:
10-
name: Check code formatting
13+
name: rustfmt
1114
runs-on: ubuntu-latest
1215
steps:
1316
- uses: actions/checkout@v4
@@ -17,4 +20,16 @@ jobs:
1720
components: rustfmt
1821

1922
- name: Rustfmt Check
20-
uses: actions-rust-lang/rustfmt@v1
23+
uses: actions-rust-lang/rustfmt@v1
24+
clippy:
25+
name: clippy
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- uses: actions-rust-lang/setup-rust-toolchain@v1
31+
with:
32+
components: clippy
33+
34+
- name: Run clippy
35+
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)