Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [0.20.7] - 2025-10-07

### Fixed
- Replaced the remaining fallible `Status::try_from` conversions in the Tonic
adapter tests with the infallible `Status::from` API so Clippy's
`unnecessary_fallible_conversions` lint passes under `-D warnings`.

## [0.20.6] - 2025-10-06

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
[package]
name = "masterror"
version = "0.20.6"
version = "0.20.7"
rust-version = "1.90"
edition = "2024"
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ The build script keeps the full feature snippet below in sync with

~~~toml
[dependencies]
masterror = { version = "0.20.6", default-features = false }
masterror = { version = "0.20.7", default-features = false }
# or with features:
# masterror = { version = "0.20.6", features = [
# masterror = { version = "0.20.7", features = [
# "axum", "actix", "openapi", "serde_json",
# "tracing", "metrics", "backtrace", "sqlx",
# "sqlx-migrate", "reqwest", "redis", "validator",
Expand Down
4 changes: 2 additions & 2 deletions src/app_error/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,6 @@ fn result_alias_is_generic() {
let default_result: super::AppResult<u8> = Ok(1);
let custom_result: super::AppResult<u8, &'static str> = Ok(2);

assert_eq!(default_result.unwrap(), 1);
assert_eq!(custom_result.unwrap(), 2);
assert!(matches!(default_result, Ok(value) if value == 1));
assert!(matches!(custom_result, Ok(value) if value == 2));
}
6 changes: 3 additions & 3 deletions src/convert/tonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ mod tests {
fn status_maps_codes_correctly() {
for (code, mapping) in CODE_MAPPINGS.iter() {
let err = AppError::with(mapping.kind(), format!("{:?}", code));
let status = Status::try_from(err).expect("status");
let status = Status::from(err);
assert_eq!(status.code(), Code::from_i32(mapping.grpc().value));
let expected_detail = format!("{:?}", code);
assert_eq!(
Expand All @@ -184,7 +184,7 @@ mod tests {
let err = AppError::internal("secret")
.redactable()
.with_field(field::str("request_id", "abc"));
let status = Status::try_from(err).expect("status");
let status = Status::from(err);
assert_eq!(status.message(), AppErrorKind::Internal.to_string());
assert!(status.metadata().get("request_id").is_none());
}
Expand All @@ -194,7 +194,7 @@ mod tests {
let err = AppError::service("downstream")
.with_field(field::str("request_id", "abc"))
.with_field(field::u64("attempt", 2));
let status = Status::try_from(err).expect("status");
let status = Status::from(err);
assert_eq!(
status
.metadata()
Expand Down
Loading