Skip to content

Commit a038c5b

Browse files
committed
Bump edition and add CI
1 parent fbf00f9 commit a038c5b

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Continuous integration
2+
on: [push, pull_request]
3+
4+
jobs:
5+
tests:
6+
name: Tests
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: dtolnay/[email protected]
11+
- uses: Swatinem/rust-cache@v2
12+
- run: cargo test --workspace --no-run
13+
- run: cargo test --workspace --no-fail-fast
14+
15+
checks:
16+
name: Check clippy, formatting, and documentation
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dtolnay/[email protected]
21+
with:
22+
components: clippy, rustfmt
23+
- uses: Swatinem/rust-cache@v2
24+
- run: cargo clippy --workspace --all-targets --all-features
25+
- run: cargo fmt --check --all
26+
- run: cargo doc --workspace --no-deps

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ categories = ["compilers"]
88
keywords = ["typst"]
99
version = "0.13.1"
1010
authors = ["The Typst Project Developers"]
11-
edition = "2021"
11+
edition = "2024"
1212
homepage = "https://typst.app"
1313
repository = "https://github.com/typst/typst-assets"
1414
license = "Apache-2.0"

codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "typst-assets-codegen"
3-
edition = "2021"
3+
edition = "2024"
44
version = "0.0.0"
55
publish = false
66

codegen/src/html.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl Type {
210210
.join(", ")
211211
),
212212
Type::List(ty, c, b) => format!("Type::List(&{}, {c:?}, {b:?})", ty.encode()),
213-
_ => format!("Type::{:?}", self),
213+
_ => format!("Type::{self:?}"),
214214
}
215215
}
216216
}
@@ -827,11 +827,11 @@ where
827827
}
828828

829829
trait StrExt {
830-
fn replace_regex(&self, re: &Regex, replacement: &str) -> Cow<str>;
830+
fn replace_regex(&self, re: &Regex, replacement: &str) -> Cow<'_, str>;
831831
}
832832

833833
impl StrExt for str {
834-
fn replace_regex(&self, re: &Regex, replacement: &str) -> Cow<str> {
834+
fn replace_regex(&self, re: &Regex, replacement: &str) -> Cow<'_, str> {
835835
re.replace_all(self, replacement)
836836
}
837837
}

0 commit comments

Comments
 (0)