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
4 changes: 2 additions & 2 deletions Cargo.lock

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

56 changes: 56 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# `error-stack-macros2` v0.1.0

The very first development version of `error-stack-macros2` is finally here!

## Features

This version (0.1.0) offers a derive macro for the [`Error`](https://doc.rust-lang.org/stable/core/error/trait.Error.html) trait which encourages the best practices for defining [`error-stack`](https://crates.io/crates/error-stack) context types.

Here's an example. This code:

```rust
use std::{
error::Error,
fmt::{self, Display, Formatter},
};

#[derive(Debug)]
pub enum CreditCardError {
InvalidInput(String),
Other,
}

impl Display for CreditCardError {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
let msg = match self {
Self::InvalidInput(_) => "credit card not found",
Self::Other => "failed to retrieve credit card",
};

f.write_str(msg)
}
}

impl Error for CreditCardError {}
```

...can now be reduced to this code:

```rust
use error_stack_macros2::Error;

#[derive(Debug, Error)]
pub enum CreditCardError {
#[display("credit card not found")]
InvalidInput(String),

#[display("failed to retrieve credit card")]
Other,
}
```

This new release also means that we will now be listening to feedback and accepting new features (macros, obviously). We are also now committed to maintaining this macro going forward and keeping our dependencies up to date.

## Previous release notes

If you want to take a look at the notes from previous releases, go to [GitHub Releases](https://github.com/LuisFerLCC/error-stack-macros2/releases).
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Version | Supported |
| ------- | --------- |
| - | - |
| 0.1.0 | ✅ |

## Report a vulnerability

Expand Down
2 changes: 1 addition & 1 deletion impl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "error-stack-macros2"
version = "0.0.0-reserved"
version = "0.1.0"
authors = ["LuisFerLCC"]
edition = "2024"
rust-version = "1.90.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "error-stack-macros2-tests"
version = "0.0.0-reserved"
version = "0.1.0"
authors = ["LuisFerLCC"]
edition = "2024"
rust-version = "1.90.0"
Expand Down