Skip to content

Commit

Permalink
refactor a bit (#100)
Browse files Browse the repository at this point in the history
* renames SRC generic of Report to D and bound it to Diagnostic

* drops SUB in generic, uses D::Subject instead

* removes lifetime from Report

* removes seal for Diagnostic
  • Loading branch information
chanced authored Jan 30, 2025
1 parent 1404c61 commit 83cf219
Show file tree
Hide file tree
Showing 10 changed files with 432 additions and 578 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Adds `Pointer::starts_with` and `Pointer::ends_with` for prefix and suffix matching.
- Adds new `ParseIndexError` variant to express the presence non-digit characters in the token.
- Adds `Token::is_next` for checking if a token represents the `-` character.
- Adds `ParseBufError`, returned as the `Err` variant of `PointerBuf::parse`, which includes the input `String` (from `Into::into`).
- Adds `InvalidEncoding` to represent the two possible encoding errors when decoding a token.
- Adds `diagnostic` mod, including:
- Adds `diagnotic::Diagnostic` trait to facilitate error reporting and
`miette` integration. All errors intended for usage with `assign::Assign` or
`resolve::Resolve` must implement this trait.
- Adds `"miette"` featureflag to enable `miette` integration for error reporting.

### Changed

Expand All @@ -24,11 +29,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Pointer::get` now accepts ranges and can produce `Pointer` segments as output (similar to
`slice::get`).
- `PointerBuf::parse` now returns `BufParseError` instead of `ParseError`.
- Adds field `position` to variants of `resolve::Error` and `assign::Error` to indicate the
token index of where the error occurred.
- Renames `ParseError::NoLeadingBackslash` to `ParseError::NoLeadingSlash`.

### Fixed

- Make validation of array indices conform to RFC 6901 in the presence of non-digit characters.

### Deprecated

- `assign::AssignError` renamed to `assign::Error`
- `resolve::ResolveError` renamed to `resolve::Error`
- `InvalidEncodingError` renamed to `EncodingError`

## [0.6.2] 2024-09-30

### Added
Expand Down
104 changes: 20 additions & 84 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rust-version = "1.79.0"
version = "0.6.3"

[dependencies]
miette = { version = "7.2.0", optional = true, features = ["fancy"] }
miette = { version = "7.4.0", optional = true, features = ["fancy"] }
serde = { version = "1.0.203", optional = true, features = ["alloc"] }
serde_json = { version = "1.0.119", optional = true, features = ["alloc"] }
toml = { version = "0.8", optional = true }
Expand Down
Loading

0 comments on commit 83cf219

Please sign in to comment.