aboutsummaryrefslogtreecommitdiff
path: root/examples/example-panic-unwind
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-17 04:05:41 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-17 04:05:41 +0800
commitaa251efb87b561f62266628f06ad341253fbbdc5 (patch)
tree7d2cc2f34f3e4a7282d8d6f0ec0f5ae4bfc87002 /examples/example-panic-unwind
parentc23c590330af83afb6e146bcd9b0a274b3689d22 (diff)
refactor!: remove legacy parser feature and migrate to picker
The legacy `parser` feature and its module tree (`mingling::parser`, `Argument`, `Picker`, `Pickable`, etc.) have been fully removed and replaced by the `picker` feature powered by `arg-picker`. BREAKING CHANGE: Remove `parser` feature and use `picker` instead. Migration guide: Replace `features = ["parser"]` with `features = ["picker"]` and update API usage per the provided table.
Diffstat (limited to 'examples/example-panic-unwind')
-rw-r--r--examples/example-panic-unwind/Cargo.lock25
-rw-r--r--examples/example-panic-unwind/Cargo.toml2
-rw-r--r--examples/example-panic-unwind/src/main.rs2
3 files changed, 20 insertions, 9 deletions
diff --git a/examples/example-panic-unwind/Cargo.lock b/examples/example-panic-unwind/Cargo.lock
index ec5492d..20671f5 100644
--- a/examples/example-panic-unwind/Cargo.lock
+++ b/examples/example-panic-unwind/Cargo.lock
@@ -3,6 +3,23 @@
version = 4
[[package]]
+name = "arg-picker"
+version = "0.2.0"
+dependencies = [
+ "arg-picker-macros",
+ "just_fmt",
+]
+
+[[package]]
+name = "arg-picker-macros"
+version = "0.2.0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.118",
+]
+
+[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -59,9 +76,9 @@ dependencies = [
name = "mingling"
version = "0.5.0"
dependencies = [
+ "arg-picker",
"mingling_core",
"mingling_macros",
- "size",
]
[[package]]
@@ -139,12 +156,6 @@ dependencies = [
]
[[package]]
-name = "size"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b6709c7b6754dca1311b3c73e79fcce40dd414c782c66d88e8823030093b02b"
-
-[[package]]
name = "syn"
version = "2.0.118"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/examples/example-panic-unwind/Cargo.toml b/examples/example-panic-unwind/Cargo.toml
index 559bdb9..463a288 100644
--- a/examples/example-panic-unwind/Cargo.toml
+++ b/examples/example-panic-unwind/Cargo.toml
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies.mingling]
path = "../../mingling"
-features = ["parser"]
+features = ["picker"]
# Enable panic unwinding in release builds
[profile.release]
diff --git a/examples/example-panic-unwind/src/main.rs b/examples/example-panic-unwind/src/main.rs
index e1aa15c..59adf07 100644
--- a/examples/example-panic-unwind/src/main.rs
+++ b/examples/example-panic-unwind/src/main.rs
@@ -41,7 +41,7 @@ fn main() {
#[chain]
fn handle_panic(prev: EntryPanic) -> Next {
- let panic_info = prev.pick::<Option<String>>(()).unpack();
+ let panic_info = prev.pick_or_default(&arg![Option<String>]).unwrap();
match panic_info {
Some(s) => {
// Panic happens here, will be caught