update dependencies

This commit is contained in:
Aiden McClelland
2022-07-11 16:03:24 -06:00
parent b4d19d71e0
commit 5f79bd9564
10 changed files with 256 additions and 239 deletions

View File

@@ -6,6 +6,6 @@ version = "0.1.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
proc-macro2 = "1.0.26"
quote = "1.0.9"
syn = { version = "1.0.68", features = ["fold"] }
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0", features = ["fold"] }

View File

@@ -338,7 +338,7 @@ fn build_app(name: LitStr, opt: &mut Options, params: &mut [ParamType]) -> Token
let required = LitBool::new(subcommand_required, Span::call_site());
let alias = &opt.common().aliases;
quote! {
pub fn build_app() -> ::rpc_toolkit::command_helpers::prelude::App<'static, 'static> {
pub fn build_app() -> ::rpc_toolkit::command_helpers::prelude::App<'static> {
let mut app = ::rpc_toolkit::command_helpers::prelude::App::new(#name);
#(
app = app.about(#about);
@@ -889,7 +889,7 @@ fn cli_handler(
_ctx: GenericContext,
_parent_data: #parent_data_ty,
_rt: Option<::rpc_toolkit::command_helpers::prelude::Runtime>,
_matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches<'_>,
_matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches,
method: ::rpc_toolkit::command_helpers::prelude::Cow<'_, str>,
_parent_params: ParentParams,
) -> Result<(), ::rpc_toolkit::command_helpers::prelude::RpcError> {
@@ -915,7 +915,7 @@ fn cli_handler(
ctx: GenericContext,
parent_data: #parent_data_ty,
mut rt: Option<::rpc_toolkit::command_helpers::prelude::Runtime>,
matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches<'_>,
matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches,
method: ::rpc_toolkit::command_helpers::prelude::Cow<'_, str>,
parent_params: ParentParams,
) -> Result<(), ::rpc_toolkit::command_helpers::prelude::RpcError> {
@@ -986,7 +986,7 @@ fn cli_handler(
ctx: GenericContext,
parent_data: #parent_data_ty,
mut rt: Option<::rpc_toolkit::command_helpers::prelude::Runtime>,
matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches<'_>,
matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches,
_method: ::rpc_toolkit::command_helpers::prelude::Cow<'_, str>,
parent_params: ParentParams
) -> Result<(), ::rpc_toolkit::command_helpers::prelude::RpcError> {
@@ -1028,7 +1028,7 @@ fn cli_handler(
ctx: GenericContext,
parent_data: #parent_data_ty,
mut rt: Option<::rpc_toolkit::command_helpers::prelude::Runtime>,
matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches<'_>,
matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches,
_method: ::rpc_toolkit::command_helpers::prelude::Cow<'_, str>,
parent_params: ParentParams
) -> Result<(), ::rpc_toolkit::command_helpers::prelude::RpcError> {
@@ -1079,7 +1079,7 @@ fn cli_handler(
_ => unreachable!(),
};
quote_spanned! { subcommand.span() =>
(#subcommand::NAME, Some(sub_m)) => {
Some((#subcommand::NAME, sub_m)) => {
let method = if method.is_empty() {
#subcommand::NAME.into()
} else {
@@ -1163,7 +1163,7 @@ fn cli_handler(
ctx: GenericContext,
parent_data: #parent_data_ty,
mut rt: Option<::rpc_toolkit::command_helpers::prelude::Runtime>,
matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches<'_>,
matches: &::rpc_toolkit::command_helpers::prelude::ArgMatches,
method: ::rpc_toolkit::command_helpers::prelude::Cow<'_, str>,
parent_params: ParentParams,
) -> Result<(), ::rpc_toolkit::command_helpers::prelude::RpcError> {

View File

@@ -86,7 +86,7 @@ pub struct ArgOptions {
help: Option<LitStr>,
name: Option<Ident>,
rename: Option<LitStr>,
short: Option<LitStr>,
short: Option<LitChar>,
long: Option<LitStr>,
parse: Option<Path>,
default: Option<LitStr>,

View File

@@ -728,13 +728,7 @@ pub fn parse_arg_attr(attr: Attribute, arg: PatType) -> Result<ArgOptions> {
return Err(Error::new(p.span(), "`rename` must be assigned to"));
}
NestedMeta::Meta(Meta::NameValue(nv)) if nv.path.is_ident("short") => {
if let Lit::Str(short) = nv.lit {
if short.value().len() != 1 {
return Err(Error::new(
short.span(),
"`short` value must be 1 character",
));
}
if let Lit::Char(short) = nv.lit {
if opt.short.is_some() {
return Err(Error::new(short.span(), "duplicate argument `short`"));
}
@@ -746,7 +740,7 @@ pub fn parse_arg_attr(attr: Attribute, arg: PatType) -> Result<ArgOptions> {
}
opt.short = Some(short);
} else {
return Err(Error::new(nv.lit.span(), "`short` must be a string"));
return Err(Error::new(nv.lit.span(), "`short` must be a char"));
}
}
NestedMeta::Meta(Meta::List(list)) if list.path.is_ident("short") => {