Skip to content

Commit

Permalink
deploy: 3b25158
Browse files Browse the repository at this point in the history
  • Loading branch information
hal3e committed Apr 15, 2024
1 parent 8d9a9aa commit 24a8597
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions master/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -2802,18 +2802,18 @@ <h2 id="generics"><a class="header" href="#generics">Generics</a></h2>
}
</code></pre>
<p>Your Rust code would look like this:</p>
<pre><code class="language-rust ignore"> // simple struct with a single generic param
let arg1 = SimpleGeneric {
single_generic_param: 123u64,
};

let result = contract_methods
.struct_w_generic(arg1.clone())
.call()
.await?
.value;

assert_eq!(result, arg1);
<pre><code class="language-rust ignore"> // simple struct with a single generic param
let arg1 = SimpleGeneric {
single_generic_param: 123u64,
};

let result = contract_methods
.struct_w_generic(arg1.clone())
.call()
.await?
.value;

assert_eq!(result, arg1);
</code></pre>
<h3 id="unused-generic-type-parameters"><a class="header" href="#unused-generic-type-parameters">Unused generic type parameters</a></h3>
<p>Sway supports unused generic type parameters when declaring structs/enums:</p>
Expand Down
24 changes: 12 additions & 12 deletions master/types/custom_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,18 @@ <h2 id="generics"><a class="header" href="#generics">Generics</a></h2>
}
</code></pre>
<p>Your Rust code would look like this:</p>
<pre><code class="language-rust ignore"> // simple struct with a single generic param
let arg1 = SimpleGeneric {
single_generic_param: 123u64,
};

let result = contract_methods
.struct_w_generic(arg1.clone())
.call()
.await?
.value;

assert_eq!(result, arg1);
<pre><code class="language-rust ignore"> // simple struct with a single generic param
let arg1 = SimpleGeneric {
single_generic_param: 123u64,
};

let result = contract_methods
.struct_w_generic(arg1.clone())
.call()
.await?
.value;

assert_eq!(result, arg1);
</code></pre>
<h3 id="unused-generic-type-parameters"><a class="header" href="#unused-generic-type-parameters">Unused generic type parameters</a></h3>
<p>Sway supports unused generic type parameters when declaring structs/enums:</p>
Expand Down

0 comments on commit 24a8597

Please sign in to comment.