Skip to content

Commit 47d10ef

Browse files
committed
Bump edition and expand CI
1 parent 72f5cac commit 47d10ef

File tree

5 files changed

+45
-18
lines changed

5 files changed

+45
-18
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
11
name: Continuous integration
22
on: [push, pull_request]
33

4+
env:
5+
RUSTFLAGS: "-Dwarnings"
6+
RUSTDOCFLAGS: "-Dwarnings"
7+
8+
permissions:
9+
contents: read
10+
411
jobs:
5-
ci:
12+
tests:
13+
name: Tests
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
17+
- uses: dtolnay/rust-toolchain@e814c742d4444ce2f3f6abddea7faf00161ed941 # 1.88.0
18+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
19+
- run: cargo test --workspace --all-features --no-run
20+
- run: cargo test --workspace --all-features --no-fail-fast
21+
- run: git diff --exit-code
22+
23+
checks:
24+
name: Check clippy, formatting, and documentation
625
runs-on: ubuntu-latest
726
steps:
8-
- uses: actions/checkout@v4
9-
- uses: dtolnay/rust-toolchain@stable
10-
- run: cargo build
11-
- run: cargo test --features=_test-unicode-conformance
27+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
28+
- uses: dtolnay/rust-toolchain@e814c742d4444ce2f3f6abddea7faf00161ed941 # 1.88.0
29+
with:
30+
components: clippy, rustfmt
31+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
32+
- run: cargo clippy --workspace --all-targets --all-features
33+
- run: cargo fmt --check --all
34+
- run: cargo doc --workspace --no-deps

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[package]
22
name = "codex"
33
version = "0.2.0"
4+
rust-version = "1.88" # also change in ci.yml
45
authors = ["The Typst Project Developers"]
5-
edition = "2021"
6+
edition = "2024"
67
description = "Human-friendly notation for Unicode symbols."
78
repository = "https://github.com/typst/codex"
89
readme = "README.md"

src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,7 @@ mod test {
159159
#[test]
160160
fn random_sample() {
161161
for (key, control) in [
162-
(
163-
"backslash",
164-
[("", "\\"), ("not", "⧷"), ("o", "⦸")].as_slice(),
165-
),
162+
("backslash", [("", "\\"), ("not", "⧷"), ("o", "⦸")].as_slice()),
166163
("chi", &[("", "χ")]),
167164
("forces", &[("", "⊩"), ("not", "⊮")]),
168165
("interleave", &[("", "⫴"), ("big", "⫼"), ("struck", "⫵")]),

src/shared.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,18 @@ mod tests {
172172

173173
#[test]
174174
fn subset() {
175-
assert!(ModifierSet::from_raw_dotted("a")
176-
.is_subset(ModifierSet::from_raw_dotted("a.b")));
177-
assert!(ModifierSet::from_raw_dotted("a")
178-
.is_subset(ModifierSet::from_raw_dotted("b.a")));
179-
assert!(ModifierSet::from_raw_dotted("a.b")
180-
.is_subset(ModifierSet::from_raw_dotted("b.c.a")));
175+
assert!(
176+
ModifierSet::from_raw_dotted("a")
177+
.is_subset(ModifierSet::from_raw_dotted("a.b"))
178+
);
179+
assert!(
180+
ModifierSet::from_raw_dotted("a")
181+
.is_subset(ModifierSet::from_raw_dotted("b.a"))
182+
);
183+
assert!(
184+
ModifierSet::from_raw_dotted("a.b")
185+
.is_subset(ModifierSet::from_raw_dotted("b.c.a"))
186+
);
181187
}
182188

183189
#[test]

src/styling.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ impl MathStyle {
228228
bold: bool,
229229
italic: Option<bool>,
230230
) -> MathStyle {
231-
use conversions::*;
232231
use MathVariant::*;
232+
use conversions::*;
233233
match (variant.unwrap_or(Plain), bold, italic) {
234234
(SansSerif, false, Some(false)) if is_latin(c) => MathStyle::SansSerif,
235235
(SansSerif, false, _) if is_latin(c) => MathStyle::SansSerifItalic,
@@ -368,8 +368,8 @@ impl fmt::Display for ToStyle {
368368
/// assert_eq!("𝕩ℽΩ𝔸𞺸𞺧𝟙⅀𞺮", s);
369369
/// ```
370370
pub fn to_style(c: char, style: MathStyle) -> ToStyle {
371-
use conversions::*;
372371
use MathStyle::*;
372+
use conversions::*;
373373
let styled = match style {
374374
Plain => [c, '\0'],
375375
Bold => [to_bold(c), '\0'],

0 commit comments

Comments
 (0)