Skip to content

Releases: mcmah309/error_set

v0.5.4

12 Sep 03:44
Compare
Choose a tag to compare
  • Support constant #[display(...)] attributes for #![no_std]

Full Changelog: v0.5.3...v0.5.4

v0.5.3

11 Sep 23:36
Compare
Choose a tag to compare

Full Changelog: v0.5.1...v0.5.3

v0.5.1

11 Sep 20:33
73fab35
Compare
Choose a tag to compare
  • Support no_std

Full Changelog: v0.5.0...v0.5.1

v0.5.0

10 Sep 16:16
Compare
Choose a tag to compare

Inline Structs and Custom Display Messages

Error sets now support inline structs and custom display messages. Similar to thiserror. Just
add the #[display(...)] attribute to the variant.

error_set! {
        SetX = {
            #[display("My name is {} and my age is {}", name, age)]
            A {
                name: String,
                age: u32,
            },
            #[display("This is the display message for B")]
            B,
            IoError(std::io::Error),
        };
        SetY = {
            C,
        } || SetX;
}
fn main() {
    let x = SetX::A {
        name: "john".to_string(),
        age: 32,
    };
    assert_eq!(x.to_string(), "My name is john and my age is 32".to_string());
}

You can redeclare the same inline struct in a different set, change the display message, and conversion between sets will still work.

Full Changelog: v0.4.5...v0.5.0

v0.4.5

23 Aug 15:13
Compare
Choose a tag to compare
  • Add more context methods for tracing/log features

Full Changelog: v0.4.4...v0.4.5

v0.4.4

22 Aug 16:04
321e2ef
Compare
Choose a tag to compare
  • Add more context methods for tracing/log features

Full Changelog: v0.4.2...v0.4.4

v0.4.2

24 Jul 05:14
Compare
Choose a tag to compare
  • Improved parsing - better error messages and spans. Writing error sets will feel even more like native Rust.

Full Changelog: v0.4.1...v0.4.2

v0.4.1

20 Jul 07:47
Compare
Choose a tag to compare
  • Add RecordContext doc to crates.io

Full Changelog: v0.4.0...v0.4.1

v0.4.0

20 Jul 05:29
Compare
Choose a tag to compare
  • Breaking: Move coerce! macro to behind a feature flag
  • Add tracing crate support behind tracing feature flag
  • Add log crate support behind log feature flag

Full Changelog: v0.3.2...v0.4.0

v0.3.2

16 Apr 00:34
Compare
Choose a tag to compare

Full Changelog: v0.3.1...v0.3.2