File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -314,7 +314,8 @@ pub fn get_capability(issuer: &Address, params: &str) -> Option<Capability> {
314314/// Example:
315315/// ```no_run
316316/// fn init(our: Address) {
317- /// Spawn!(|our| {
317+ /// let parent = our.clone();
318+ /// Spawn!(|parent: Address| {
318319/// println!("hello from {our}. I am Spawn of {}!", args["our"]);
319320/// });
320321/// ...
@@ -329,9 +330,6 @@ pub fn get_capability(issuer: &Address, params: &str) -> Option<Capability> {
329330/// (i.e. `Cargo.toml`, `metadata.json`, etc.).
330331#[ macro_export]
331332macro_rules! Spawn {
332- // Matches a closure with one parameter
333- ( |$param: ident| $body: block) => { } ;
334-
335- // If you also need to support multiple parameters in the closure:
336- ( |$( $param: ident) ,* | $body: block) => { } ;
333+ // Match one or more type-annotated parameters
334+ ( |$( $param: ident : $type: ty) ,+ $( , ) ?| $body: block) => { } ;
337335}
You can’t perform that action at this time.
0 commit comments