Skip to content

Commit c1332fd

Browse files
committed
Clippy
1 parent aba9454 commit c1332fd

File tree

19 files changed

+152
-152
lines changed

19 files changed

+152
-152
lines changed

.github/workflows/rust.yml

Lines changed: 119 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -18,52 +18,50 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
Fmt:
22-
runs-on: ubuntu-latest
23-
steps:
24-
- uses: actions/checkout@v4
25-
26-
- name: Install rust
27-
uses: dtolnay/rust-toolchain@master
28-
with:
29-
toolchain: nightly
30-
components: rustfmt
31-
32-
- name: fmt
33-
run: cargo fmt -- --check
34-
35-
CargoSort:
36-
name: Check order in Cargo.toml
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v4
40-
- uses: taiki-e/install-action@v2
41-
with:
42-
tool: cargo-sort
43-
- run: cargo sort --workspace --grouped --check --check-format
44-
45-
Build:
46-
needs:
47-
- Fmt
48-
- CargoSort
49-
runs-on: ubuntu-latest
50-
steps:
51-
- uses: actions/checkout@v4
52-
53-
- name: Install rust
54-
uses: dtolnay/rust-toolchain@master
55-
with:
56-
toolchain: stable
57-
58-
- uses: Swatinem/rust-cache@v2
59-
60-
- name: Compile project
61-
run: cargo build --bench template-benchmark --release
21+
# Fmt:
22+
# runs-on: ubuntu-latest
23+
# steps:
24+
# - uses: actions/checkout@v4
25+
#
26+
# - name: Install rust
27+
# uses: dtolnay/rust-toolchain@master
28+
# with:
29+
# toolchain: nightly
30+
# components: rustfmt
31+
#
32+
# - name: fmt
33+
# run: cargo fmt -- --check
34+
#
35+
# CargoSort:
36+
# name: Check order in Cargo.toml
37+
# runs-on: ubuntu-latest
38+
# steps:
39+
# - uses: actions/checkout@v4
40+
# - uses: taiki-e/install-action@v2
41+
# with:
42+
# tool: cargo-sort
43+
# - run: cargo sort --workspace --grouped --check --check-format
44+
#
45+
# Build:
46+
# needs:
47+
# - Fmt
48+
# - CargoSort
49+
# runs-on: ubuntu-latest
50+
# steps:
51+
# - uses: actions/checkout@v4
52+
#
53+
# - name: Install rust
54+
# uses: dtolnay/rust-toolchain@master
55+
# with:
56+
# toolchain: stable
57+
#
58+
# - name: Compile project
59+
# run: cargo build --bench template-benchmark --release
6260

6361
Clippy:
64-
needs:
65-
- Fmt
66-
- CargoSort
62+
# needs:
63+
# - Fmt
64+
# - CargoSort
6765
runs-on: ubuntu-latest
6866
steps:
6967
- uses: actions/checkout@v4
@@ -74,87 +72,83 @@ jobs:
7472
toolchain: stable
7573
components: clippy
7674

77-
- uses: Swatinem/rust-cache@v2
78-
7975
- name: clippy
8076
run: cargo clippy -- -D warnings
8177

82-
Audit:
83-
needs:
84-
- Fmt
85-
- CargoSort
86-
runs-on: ubuntu-latest
87-
steps:
88-
- uses: actions/checkout@v4
89-
- uses: EmbarkStudios/cargo-deny-action@v2
90-
91-
DevSkim:
92-
needs:
93-
- Fmt
94-
- CargoSort
95-
runs-on: ubuntu-latest
96-
permissions:
97-
actions: read
98-
contents: read
99-
security-events: write
100-
steps:
101-
- uses: actions/checkout@v4
102-
103-
- name: Run DevSkim scanner
104-
uses: microsoft/DevSkim-Action@v1
105-
106-
- name: Upload DevSkim scan results to GitHub Security tab
107-
uses: github/codeql-action/upload-sarif@v3
108-
with:
109-
sarif_file: devskim-results.sarif
110-
111-
deploy:
112-
if: github.ref == 'refs/heads/main'
113-
needs:
114-
- Build
115-
- Clippy
116-
- Audit
117-
- DevSkim
118-
environment:
119-
name: github-pages
120-
url: ${{ steps.deployment.outputs.page_url }}
121-
runs-on: ubuntu-latest
122-
steps:
123-
- uses: actions/checkout@v4
124-
125-
- name: Install dependencies
126-
run: |
127-
sudo apt-get update
128-
sudo apt-get install -y coreutils gnuplot inkscape retry scour wkhtmltopdf xvfb
129-
130-
- name: Install rust
131-
uses: dtolnay/rust-toolchain@master
132-
with:
133-
toolchain: stable
134-
135-
- uses: Swatinem/rust-cache@v2
136-
137-
- name: Remove any stale results
138-
run: rm -rf target/criterion
139-
140-
- name: Build benchmarks
141-
run: cargo build --release --bench template-benchmark
142-
143-
- name: Run benchmarks
144-
# Pin to one CPU, skipping the first core, to hopefully get fewer outliers.
145-
run: taskset --cpu-list "$(( $RANDOM % ($(nproc) - 2) + 2 ))" cargo bench --bench template-benchmark -- --nocapture
146-
147-
- name: Fixup paths
148-
run: sed -e 's,href="../,href=",' < target/criterion/report/index.html > target/criterion/index.html
149-
150-
- name: Generate table
151-
run: timeout 300 retry timeout 30 ./generate-table.py
152-
153-
- name: Upload artifact
154-
uses: actions/upload-pages-artifact@v3
155-
with:
156-
path: 'target/criterion'
157-
158-
- name: Deploy to GitHub Pages
159-
id: deployment
160-
uses: actions/deploy-pages@v4
78+
# Audit:
79+
# needs:
80+
# - Fmt
81+
# - CargoSort
82+
# runs-on: ubuntu-latest
83+
# steps:
84+
# - uses: actions/checkout@v4
85+
# - uses: EmbarkStudios/cargo-deny-action@v2
86+
#
87+
# DevSkim:
88+
# needs:
89+
# - Fmt
90+
# - CargoSort
91+
# runs-on: ubuntu-latest
92+
# permissions:
93+
# actions: read
94+
# contents: read
95+
# security-events: write
96+
# steps:
97+
# - uses: actions/checkout@v4
98+
#
99+
# - name: Run DevSkim scanner
100+
# uses: microsoft/DevSkim-Action@v1
101+
#
102+
# - name: Upload DevSkim scan results to GitHub Security tab
103+
# uses: github/codeql-action/upload-sarif@v3
104+
# with:
105+
# sarif_file: devskim-results.sarif
106+
#
107+
# deploy:
108+
# if: github.ref == 'refs/heads/main'
109+
# needs:
110+
# - Build
111+
# - Clippy
112+
# - Audit
113+
# - DevSkim
114+
# environment:
115+
# name: github-pages
116+
# url: ${{ steps.deployment.outputs.page_url }}
117+
# runs-on: ubuntu-latest
118+
# steps:
119+
# - uses: actions/checkout@v4
120+
#
121+
# - name: Install dependencies
122+
# run: |
123+
# sudo apt-get update
124+
# sudo apt-get install -y coreutils gnuplot inkscape retry scour wkhtmltopdf xvfb
125+
#
126+
# - name: Install rust
127+
# uses: dtolnay/rust-toolchain@master
128+
# with:
129+
# toolchain: stable
130+
#
131+
# - name: Remove any stale results
132+
# run: rm -rf target/criterion
133+
#
134+
# - name: Build benchmarks
135+
# run: cargo build --release --bench template-benchmark
136+
#
137+
# - name: Run benchmarks
138+
# # Pin to one CPU, skipping the first core, to hopefully get fewer outliers.
139+
# run: taskset --cpu-list "$(( $RANDOM % ($(nproc) - 2) + 2 ))" cargo bench --bench template-benchmark -- --nocapture
140+
#
141+
# - name: Fixup paths
142+
# run: sed -e 's,href="../,href=",' < target/criterion/report/index.html > target/criterion/index.html
143+
#
144+
# - name: Generate table
145+
# run: timeout 300 retry timeout 30 ./generate-table.py
146+
#
147+
# - name: Upload artifact
148+
# uses: actions/upload-pages-artifact@v3
149+
# with:
150+
# path: 'target/criterion'
151+
#
152+
# - name: Deploy to GitHub Pages
153+
# id: deployment
154+
# uses: actions/deploy-pages@v4

.rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
edition = "2021"
1+
edition = "2024"
22
group_imports = "StdExternalCrate"
33
imports_granularity = "Module"
44
newline_style = "Unix"

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ members = [
1212
"tmpls/tera",
1313
"tmpls/tinytemplate",
1414
]
15-
resolver = "2"
15+
resolver = "3"
1616

1717
[package]
1818
name = "template-benchmark"
1919
version = "0.1.0"
20-
edition = "2021"
20+
edition = "2024"
2121
publish = false
2222
license = "Apache-2.0"
2323

@@ -61,15 +61,15 @@ tera = { version = "*", optional = true, path = "tmpls/tera", package = "tmpl-te
6161
tinytemplate = { version = "*", optional = true, path = "tmpls/tinytemplate", package = "tmpl-tinytemplate" }
6262
vy = { version = "*", optional = true, path = "tmpls/vy", package = "tmpl-vy" }
6363

64-
ahash = { version = "0.8.11", features = ["no-rng"] }
65-
criterion = { version = "0.5.1", features = ["html_reports"] }
66-
pretty-error-debug = "0.3.1"
67-
thiserror = "2.0.12"
64+
ahash = { version = "0.8", features = ["no-rng"] }
65+
criterion = { version = "0.5", features = ["html_reports"] }
66+
pretty-error-debug = "0.3"
67+
thiserror = "2"
6868

6969
[build-dependencies]
7070
pretty-error-debug = "0.3"
71-
self_cell = "1.2.0"
72-
thiserror = "2.0.12"
71+
self_cell = "1"
72+
thiserror = "2"
7373

7474
[[bench]]
7575
name = "template-benchmark"

build.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
#![allow(clippy::uninlined_format_args)] // I don't care
2+
13
use std::ffi::{OsStr, OsString};
24
use std::process::{Command, Stdio};
35

46
fn main() -> Result<(), Error> {
5-
println!("cargo:rerun-if-changed=Cargo.lock");
7+
println!("cargo::rerun-if-changed=build.rs");
8+
println!("cargo::rerun-if-changed=Cargo.lock");
69

710
let cargo = var_os("CARGO")?;
811
let root = var_os("CARGO_MANIFEST_DIR")?;
@@ -39,7 +42,7 @@ fn main() -> Result<(), Error> {
3942
break;
4043
}
4144
}
42-
Ok(())
45+
Err(Error::Test)
4346
}
4447

4548
fn var_os(key: &'static str) -> Result<OsString, Error> {
@@ -69,6 +72,7 @@ fn cargo_tree(cargo: &OsStr, root: &OsStr, package: &str) -> Result<CargoTreeOut
6972
if !output.status.success() {
7073
return Err(Error::Status(output.status));
7174
}
75+
let _ = dbg!((cargo, root, package, std::str::from_utf8(&output.stdout)));
7276

7377
Ok(CargoTreeOutput::new(
7478
String::from_utf8(output.stdout).map_err(|_| Error::Utf8)?,
@@ -111,4 +115,6 @@ enum Error {
111115
Status(std::process::ExitStatus),
112116
#[error("`cargo` returned non-UTF-8 data")]
113117
Utf8,
118+
#[error("TEST")]
119+
Test,
114120
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn tmpl<B: Benchmark>(case: Case) -> Result<(), Error> {
125125
result.map_err(|err| Error::Execution(Box::new(err)))?;
126126

127127
let bytes = from_utf8(output.as_bytes()).map_err(Error::Utf8)?;
128-
println!("{}", bytes);
128+
println!("{bytes}");
129129

130130
Ok(())
131131
}

tmpls/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tmpls"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
publish = false
66
license = "Apache-2.0"
77

tmpls/askama/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tmpl-askama"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
publish = false
66
license = "Apache-2.0"
77

tmpls/askama_git/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tmpl-askama_git"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
publish = false
66
license = "Apache-2.0"
77

tmpls/handlebars/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tmpl-handlebars"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
publish = false
66
license = "Apache-2.0"
77

tmpls/horrorshow/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tmpl-horrorshow"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
publish = false
66
license = "Apache-2.0"
77

0 commit comments

Comments
 (0)