diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-23 00:40:05 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-23 00:40:05 +0800 |
| commit | 1df1fc664c4a4b12807a49ef2f1a0effda6ce064 (patch) | |
| tree | a5bcdab31e18094b226d6cef36d99c879c64e25f /docs/_zh_CN | |
| parent | d94103fd7e76dd86cd64c23f00c818165fb7dc22 (diff) | |
Add compile-time duplicate variant detection
Add duplicate variant checks for chain, renderer, help, and completion
registrations to produce a clear compile error instead of silently
generating unreachable code
Diffstat (limited to 'docs/_zh_CN')
| -rw-r--r-- | docs/_zh_CN/pages/other/features.md | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/_zh_CN/pages/other/features.md b/docs/_zh_CN/pages/other/features.md index cdb2220..558720c 100644 --- a/docs/_zh_CN/pages/other/features.md +++ b/docs/_zh_CN/pages/other/features.md @@ -25,7 +25,7 @@ pack!(StateFoo = ()); #[chain] async fn handle_state_foo(foo: StateFoo) -> Next { StateFoo::new(()) -} +} ``` 详见 [示例](https://mingling-rs.github.io/mingling/docs/example-viewer.html?name=example-async-support) @@ -92,14 +92,14 @@ fn main() { 例如,允许 `dispatcher!("greet")` 的缩写形式,自动生成 `CMDGreet` / `EntryGreet`。 -| 宏 | 说明 | -|---|---| -| `empty_result!()` | 链中提前返回空结果的简写 | -| `entry!(Type, ["a", "b"])` | 构造入口类型的测试数据 | -| `group!(Type)` | 将外部类型注册为组成员,无需修改其定义 | -| `pack_err!(ErrorType)` / `pack_err!(ErrorType = Inner)` | 创建带自动 `name` 字段的错误类型 | -| `#[program_setup]` | 声明程序初始化函数 | -| `dispatcher!("cmd.path")` **缩写形式** | 省略 `CMDStruct => EntryStruct`,名字自动推导 | +| 宏 | 说明 | +| ------------------------------------------------------- | --------------------------------------------- | +| `empty_result!()` | 链中提前返回空结果的简写 | +| `entry!(Type, ["a", "b"])` | 构造入口类型的测试数据 | +| `group!(Type)` | 将外部类型注册为组成员,无需修改其定义 | +| `pack_err!(ErrorType)` / `pack_err!(ErrorType = Inner)` | 创建带自动 `name` 字段的错误类型 | +| `#[program_setup]` | 声明程序初始化函数 | +| `dispatcher!("cmd.path")` **缩写形式** | 省略 `CMDStruct => EntryStruct`,名字自动推导 | <details> <summary> Details </summary> @@ -115,7 +115,7 @@ pack!(StatePrev2 = ()); pack!(StateNext = ()); #[chain] -fn handle_state_prev2(_p: StatePrev1) { +fn handle_state_prev2(_p: StatePrev2) { // 无 Next 的 #[chain] 可以直接不返回值 } |
