Skip to content

Commit 2bc452d

Browse files
committed
Use typos to check for spelling mistakes.
1 parent 397aa40 commit 2bc452d

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

.github/workflows/pr-checks.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- main
88
pull_request:
99

10+
env:
11+
CLICOLOR: 1
12+
1013
jobs:
1114
clippy:
1215
name: cargo clippy
@@ -68,3 +71,11 @@ jobs:
6871
- run: cargo test --features unescape
6972
- run: cargo test --features entities
7073
- run: cargo test
74+
75+
typos:
76+
name: typos
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- uses: actions/checkout@v5
81+
- uses: crate-ci/typos@v1.38.1

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ repos:
1818
- id: mixed-line-ending
1919
args: ["--fix=no"]
2020
- id: no-commit-to-branch
21+
- repo: https://github.com/crate-ci/typos
22+
rev: v1.38.1
23+
hooks:
24+
- id: typos
25+
args: []
2126
- repo: local
2227
hooks:
2328
- id: cargo clippy

.typos.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[files]
2+
extend-exclude = [
3+
"target",
4+
"entities.json",
5+
"tests/corpus",
6+
]

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55
## main branch
66

77
* Clarify examples in documentation and README.
8+
* Fix a few spelling mistakes in documentation.
89

910
## Release 1.0.6 (2025-04-26)
1011

src/unescape.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ include!(concat!(env!("OUT_DIR"), "/matcher.rs"));
316316
/// point to the next character after the entity.
317317
/// * It doesn’t find a match: returns `None` and `iter` is updated to point
318318
/// to the next character than could plausibly start an entity (not
319-
/// necessarily b'&', though; the only gaurantee is that we didn’t skip a
319+
/// necessarily b'&', though; the only guarantee is that we didn’t skip a
320320
/// potential entity).
321321
///
322322
/// This version uses matchgen instead of the `ENTITIES` map. It is faster at
@@ -375,7 +375,7 @@ const PEEK_MATCH_ERROR: &str = "iter.next() did not match previous peek(iter)";
375375
/// point to the next character after the entity.
376376
/// * It doesn’t find a match: returns `None` and `iter` is updated to point
377377
/// to the next character than could plausibly start an entity (not
378-
/// necessarily b'&', though; the only gaurantee is that we didn’t skip a
378+
/// necessarily b'&', though; the only guarantee is that we didn’t skip a
379379
/// potential entity).
380380
///
381381
/// This version uses the [`ENTITIES`] map instead of matchgen. It is slower at
@@ -500,8 +500,8 @@ fn match_entity_slow<'a>(
500500
fn match_numeric_entity(
501501
iter: &mut slice::Iter<u8>,
502502
) -> Option<Cow<'static, [u8]>> {
503-
assert_next_eq(iter, Some(b'&'), "match_numeric_entity() expexted '&'");
504-
assert_next_eq(iter, Some(b'#'), "match_numeric_entity() expexted '#'");
503+
assert_next_eq(iter, Some(b'&'), "match_numeric_entity() expected '&'");
504+
assert_next_eq(iter, Some(b'#'), "match_numeric_entity() expected '#'");
505505

506506
let number = match peek(iter) {
507507
c @ Some(b'x' | b'X') => {

0 commit comments

Comments
 (0)