From a05c914e0a4dbd5bbbfc793752479a4d83457bc1 Mon Sep 17 00:00:00 2001 From: Hanh Date: Fri, 13 Sep 2024 03:25:24 +1000 Subject: [PATCH] More bindings --- dart-warp | 2 +- warp-macros/src/lib.rs | 14 ++++++++++++++ zcash-warp | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dart-warp b/dart-warp index b6e49a5..8334193 160000 --- a/dart-warp +++ b/dart-warp @@ -1 +1 @@ -Subproject commit b6e49a51886c3956b90fb9d444c7c2cc8e599127 +Subproject commit 83341935feb05508e3b2316dd1aaa72b5b31479f diff --git a/warp-macros/src/lib.rs b/warp-macros/src/lib.rs index 57c8ff7..6ba765b 100644 --- a/warp-macros/src/lib.rs +++ b/warp-macros/src/lib.rs @@ -121,6 +121,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { let mut has_connection = false; let mut mut_connection = false; let mut has_client = false; + let mut has_url = false; for input in inputs.iter() { if let FnArg::Typed(pat) = input { if let Pat::Ident(param) = pat.pat.as_ref() { @@ -134,6 +135,10 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { has_network = true; continue; } + "url" => { + has_url = true; + continue; + } "connection" => { has_connection = true; if type_name == "& mut Connection" { @@ -214,6 +219,13 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { } else { quote! {} }; + let url = if has_url { + quote! { + let url = coin.url.clone(); + } + } else { + quote! {} + }; let connection = if has_connection { if mut_connection { quote! { @@ -264,6 +276,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { }; #network #connection + #url #client #(#convs)* #ident(#(#args),*).await @@ -285,6 +298,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { }; #network #connection + #url #client #(#convs)* #ident(#(#args),*) diff --git a/zcash-warp b/zcash-warp index 87396f5..4118e44 160000 --- a/zcash-warp +++ b/zcash-warp @@ -1 +1 @@ -Subproject commit 87396f5558ed984387150e566bd4e9c3f9e4f6d4 +Subproject commit 4118e4431ff905327daf549946f70f8d5558e5fc