From 0f7b2a50b05f38d886234ff6b031766c7af1dabb Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 18 Jun 2026 22:48:16 +0800 Subject: Add `pack_err!` macro for error structs with automatic name field --- docs/example-pages/examples.json | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/example-pages/examples.json b/docs/example-pages/examples.json index e7f0c0c..8e8719b 100644 --- a/docs/example-pages/examples.json +++ b/docs/example-pages/examples.json @@ -219,6 +219,23 @@ "Cargo.toml" ] }, + { + "id": "example-pack-err", + "name": "pack_err!", + "icon": "🛑", + "category": "macros", + "desc": "Demonstrates how to use the `pack_err!` macro to define error types with automatic `name` field (snake_case at compile time) and optional `info` field. Also shows `--json` serialization when `general_renderer` is enabled.\n", + "tags": [ + "pack_err!", + "extra_macros", + "general_renderer", + "--json" + ], + "files": [ + "src/main.rs", + "Cargo.toml" + ] + }, { "id": "example-panic-unwind", "name": "Panic Unwind", @@ -258,9 +275,8 @@ "injection" ], "files": [ - "Cargo.toml", "src/main.rs", - "src/lib.rs" + "Cargo.toml" ] }, { @@ -289,8 +305,8 @@ "extra_macros" ], "files": [ - "Cargo.toml", - "src/main.rs" + "src/main.rs", + "Cargo.toml" ] }, { -- cgit