aboutsummaryrefslogtreecommitdiff
path: root/examples/example-completion
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-19 00:31:05 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-19 00:31:05 +0800
commit532f4ceba2bddb1c84d2e0bdd69808a3ebd5ca4a (patch)
tree043514a2aca670d8b2398726b17aab1066938ba1 /examples/example-completion
parentecc1329bbd31cd98fa9b4c2f25a3114f133987ae (diff)
Make async an optional feature
Diffstat (limited to 'examples/example-completion')
-rw-r--r--examples/example-completion/Cargo.lock36
-rw-r--r--examples/example-completion/Cargo.toml1
-rw-r--r--examples/example-completion/src/main.rs7
3 files changed, 3 insertions, 41 deletions
diff --git a/examples/example-completion/Cargo.lock b/examples/example-completion/Cargo.lock
index 627bf49..08f1f22 100644
--- a/examples/example-completion/Cargo.lock
+++ b/examples/example-completion/Cargo.lock
@@ -3,17 +3,10 @@
version = 4
[[package]]
-name = "bytes"
-version = "1.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
-
-[[package]]
name = "example-completion"
version = "0.0.1"
dependencies = [
"mingling",
- "tokio",
]
[[package]]
@@ -48,7 +41,6 @@ dependencies = [
"just_template",
"once_cell",
"thiserror",
- "tokio",
]
[[package]]
@@ -69,12 +61,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
[[package]]
-name = "pin-project-lite"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
-
-[[package]]
name = "proc-macro2"
version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -130,28 +116,6 @@ dependencies = [
]
[[package]]
-name = "tokio"
-version = "1.51.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f66bf9585cda4b724d3e78ab34b73fb2bbaba9011b9bfdf69dc836382ea13b8c"
-dependencies = [
- "bytes",
- "pin-project-lite",
- "tokio-macros",
-]
-
-[[package]]
-name = "tokio-macros"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/examples/example-completion/Cargo.toml b/examples/example-completion/Cargo.toml
index 984adaf..6a76d1f 100644
--- a/examples/example-completion/Cargo.toml
+++ b/examples/example-completion/Cargo.toml
@@ -5,4 +5,3 @@ edition = "2024"
[dependencies]
mingling = { path = "../../mingling", features = ["comp", "parser"] }
-tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] }
diff --git a/examples/example-completion/src/main.rs b/examples/example-completion/src/main.rs
index 807be3f..2e21a5c 100644
--- a/examples/example-completion/src/main.rs
+++ b/examples/example-completion/src/main.rs
@@ -54,12 +54,11 @@ fn comp_fruit_command(ctx: &ShellContext) -> Suggest {
return suggest!();
}
-#[tokio::main]
-async fn main() {
+fn main() {
let mut program = ThisProgram::new();
program.with_dispatcher(CompletionDispatcher);
program.with_dispatcher(FruitCommand);
- program.exec().await;
+ program.exec();
}
#[derive(Groupped)]
@@ -98,7 +97,7 @@ enum FruitType {
impl PickableEnum for FruitType {}
#[chain]
-async fn parse_fruit_info(prev: FruitEntry) -> NextProcess {
+fn parse_fruit_info(prev: FruitEntry) -> NextProcess {
let picker = Picker::<()>::from(prev.inner);
let (fruit_name, fruit_type) = picker.pick("--name").pick("--type").unpack_directly();
let info = FruitInfo {