Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Add missing Clone trait to code (#73)
Browse files Browse the repository at this point in the history
Clone trait is required, without it the code cannot be compiled.
  • Loading branch information
overcat authored Aug 4, 2022
1 parent 44c337a commit 41e71e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/examples/custom-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ test test::test ... ok

```rust title="custom_types/src/lib.rs"
#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum Name {
None,
FirstLast(FirstLast),
}

#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FirstLast {
pub first: Symbol,
pub last: Symbol,
Expand Down Expand Up @@ -87,6 +89,7 @@ Field names must be no more than 10 characters.

```rust
#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FirstLast {
pub first: Symbol,
pub last: Symbol,
Expand All @@ -104,6 +107,7 @@ below, are supported.

```rust
#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum Name {
None,
FirstLast(FirstLast),
Expand Down

0 comments on commit 41e71e8

Please sign in to comment.