From 745cd132aae5d6fa24356ef8b8e096293ebfad59 Mon Sep 17 00:00:00 2001 From: vkill Date: Thu, 9 Dec 2021 16:32:03 +0800 Subject: [PATCH] Upgrade dep clap to 3.0.0-rc.0 (#113) --- crates/cli/Cargo.toml | 2 +- crates/cli/src/lib.rs | 12 ++++++------ crates/cli/src/main.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 8e8f6c9f17..9a71cacc3e 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -13,7 +13,7 @@ categories = ["api-bindings", "command-line-interface"] [dependencies] ext-php-rs = { version = ">=0.7.1", path = "../../" } -clap = "3.0.0-beta.5" +clap = { version = "3.0.0-rc.0", features = ["derive"] } anyhow = "1" dialoguer = "0.9" libloading = "0.7" diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index b75fcb5d03..8f5ec99c46 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -37,10 +37,10 @@ macro_rules! stub_symbols { } /// Result type returned from the [`run`] function. -pub type Result = anyhow::Result<()>; +pub type CrateResult = AResult<()>; /// Runs the CLI application. Returns nothing in a result on success. -pub fn run() -> Result { +pub fn run() -> CrateResult { let mut args: Vec<_> = std::env::args().collect(); // When called as a cargo subcommand, the second argument given will be the @@ -150,7 +150,7 @@ struct Stubs { } impl Args { - pub fn handle(self) -> Result { + pub fn handle(self) -> CrateResult { match self { Args::Install(install) => install.handle(), Args::Remove(remove) => remove.handle(), @@ -160,7 +160,7 @@ impl Args { } impl Install { - pub fn handle(self) -> Result { + pub fn handle(self) -> CrateResult { let artifact = find_ext(&self.manifest)?; let ext_path = build_ext(&artifact, self.release)?; @@ -230,7 +230,7 @@ impl Install { } impl Remove { - pub fn handle(self) -> Result { + pub fn handle(self) -> CrateResult { use std::env::consts; let artifact = find_ext(&self.manifest)?; @@ -296,7 +296,7 @@ impl Remove { } impl Stubs { - pub fn handle(self) -> Result { + pub fn handle(self) -> CrateResult { let ext_path = if let Some(ext_path) = self.ext { ext_path } else { diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 57e19c14d0..d62ac98550 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -7,6 +7,6 @@ macro_rules! bind { include!("../allowed_bindings.rs"); -fn main() -> cargo_php::Result { +fn main() -> cargo_php::CrateResult { cargo_php::run() }