Skip to content

Commit 9eb2b10

Browse files
committed
unused
1 parent a55f4a4 commit 9eb2b10

File tree

6 files changed

+34
-81
lines changed

6 files changed

+34
-81
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v6
2222

23-
- name: install `just`
24-
run: sudo snap install --edge --classic just
25-
26-
- uses: cargo-bins/cargo-binstall@main
23+
- uses: taiki-e/install-action@v2
24+
with:
25+
tool: just,sqlx-cli
2726

2827
- name: restore build & cargo cache
2928
uses: Swatinem/rust-cache@v2
@@ -33,9 +32,6 @@ jobs:
3332
- name: Set up Docker Buildx
3433
uses: docker/setup-buildx-action@v3
3534

36-
- name: install SQLX CLI
37-
run: cargo binstall sqlx-cli
38-
3935
- name: run sqlx migration up & down
4036
run: |
4137
just sqlx-migrate-run \
@@ -51,8 +47,9 @@ jobs:
5147
steps:
5248
- uses: actions/checkout@v6
5349

54-
- name: install `just`
55-
run: sudo snap install --edge --classic just
50+
- uses: taiki-e/install-action@v2
51+
with:
52+
tool: just
5653

5754
- name: restore build & cargo cache
5855
uses: Swatinem/rust-cache@v2
@@ -77,8 +74,9 @@ jobs:
7774
- name: Set up Docker Buildx
7875
uses: docker/setup-buildx-action@v3
7976

80-
- name: install `just`
81-
run: sudo snap install --edge --classic just
77+
- uses: taiki-e/install-action@v2
78+
with:
79+
tool: just
8280

8381
- name: Run GUI tests
8482
run: just run-gui-tests
@@ -94,18 +92,16 @@ jobs:
9492
steps:
9593
- uses: actions/checkout@v6
9694

97-
- name: install `just`
98-
run: sudo snap install --edge --classic just
95+
- uses: taiki-e/install-action@v2
96+
with:
97+
tool: just,cargo-machete
9998

10099
- name: restore build & cargo cache
101100
uses: Swatinem/rust-cache@v2
102101
with:
103102
prefix-key: ${{ env.RUST_CACHE_KEY }}
104103

105-
- name: Set up Docker Buildx
106-
uses: docker/setup-buildx-action@v3
107-
108-
- run: just lint
104+
- run: just lint lint-dependencies
109105

110106
lint-js:
111107
name: js linters
@@ -115,8 +111,9 @@ jobs:
115111

116112
- uses: denoland/setup-deno@v2
117113

118-
- name: install `just`
119-
run: sudo snap install --edge --classic just
114+
- uses: taiki-e/install-action@v2
115+
with:
116+
tool: just
120117

121118
- run: just lint-js
122119

Cargo.lock

Lines changed: 2 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ strum = { version = "0.27.0", features = ["derive"] }
5454
lol_html = "2.0.0"
5555
font-awesome-as-a-crate = { path = "crates/font-awesome-as-a-crate" }
5656
dashmap = "6.0.0"
57-
string_cache = "0.9.0"
5857
zip = {version = "6.0.0", default-features = false, features = ["bzip2"]}
5958
bzip2 = "0.6.0"
6059
getrandom = "0.3.1"
@@ -75,8 +74,6 @@ aws-config = { version = "1.0.0", default-features = false, features = ["rt-toki
7574
aws-sdk-s3 = "1.3.0"
7675
aws-smithy-types-convert = { version = "0.60.0", features = ["convert-chrono"] }
7776
http = "1.0.0"
78-
uuid = { version = "1.1.2", features = ["v4"]}
79-
8077

8178
# Data serialization and deserialization
8279
serde = { version = "1.0", features = ["derive"] }
@@ -125,13 +122,15 @@ pretty_assertions = "1.4.0"
125122
[build-dependencies]
126123
time = "0.3"
127124
md5 = "0.8.0"
128-
string_cache_codegen = "0.6.1"
129125
phf_codegen = "0.13"
130126
walkdir = "2"
131127
anyhow = { version = "1.0.42", features = ["backtrace"] }
132128
grass = { version = "0.13.1", default-features = false }
133129
syntect = { version = "5.0.0", default-features = false, features = ["parsing", "dump-create", "yaml-load", "regex-onig"] }
134130

131+
[package.metadata.cargo-machete]
132+
ignored = ["phf"]
133+
135134
[[bench]]
136135
name = "compression"
137136
harness = false

build.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ fn main() -> Result<()> {
7878
let mut etag_map: ETagMap = ETagMap::new();
7979

8080
compile_sass(out_dir, &mut etag_map)?;
81-
write_known_targets(out_dir)?;
8281
compile_syntax(out_dir).context("could not compile syntax files")?;
8382
calculate_static_etags(&mut etag_map)?;
8483

@@ -226,24 +225,6 @@ fn calculate_static_etags(etag_map: &mut ETagMap) -> Result<()> {
226225
Ok(())
227226
}
228227

229-
fn write_known_targets(out_dir: &Path) -> Result<()> {
230-
use std::io::BufRead;
231-
232-
let targets: Vec<String> = std::process::Command::new("rustc")
233-
.args(["--print", "target-list"])
234-
.output()?
235-
.stdout
236-
.lines()
237-
.filter(|s| s.as_ref().map_or(true, |s| !s.is_empty()))
238-
.collect::<std::io::Result<_>>()?;
239-
240-
string_cache_codegen::AtomType::new("target::TargetAtom", "target_atom!")
241-
.atoms(&targets)
242-
.write_to_file(&out_dir.join("target_atom.rs"))?;
243-
244-
Ok(())
245-
}
246-
247228
fn compile_syntax(out_dir: &Path) -> Result<()> {
248229
use syntect::{
249230
dumps::dump_to_uncompressed_file,

justfiles/testing.just

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ clippy-fix:
5454

5555
# run all linters, for local development & CI
5656
[group('testing')]
57-
lint: format
57+
lint: format lint-depencences
5858
#!/usr/bin/env bash
5959
set -euo pipefail
6060

@@ -64,6 +64,18 @@ lint: format
6464
just clippy-fix
6565
fi
6666

67+
[group('testing')]
68+
lint-dependencies:
69+
# check unused deps with cargo machete is fast,
70+
# but has many false positives.
71+
# While it can also recurse into subdirs, it would
72+
# also stumble onto our broken crates in `/tests/crates/*`,
73+
# where I also don't want to add machete-metadata.
74+
@fd \
75+
--glob 'Cargo.toml' \
76+
--type file \
77+
--exclude tests \
78+
-X cargo machete {}
6779

6880
[group('testing')]
6981
lint-js *args:

src/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ mod test;
3333
pub mod utils;
3434
mod web;
3535

36-
#[allow(dead_code)]
37-
mod target {
38-
//! [`crate::target::TargetAtom`] is an interned string type for rustc targets, such as
39-
//! `x86_64-unknown-linux-gnu`. See the [`string_cache`] docs for usage examples.
40-
include!(concat!(env!("OUT_DIR"), "/target_atom.rs"));
41-
}
42-
4336
use web::page::GlobalAlert;
4437

4538
// Warning message shown in the navigation bar of every page. Set to `None` to hide it.

0 commit comments

Comments
 (0)