Skip to content

Commit

Permalink
[dynamic-fields/docs] Add ctx argument to sui::table::new example (My…
Browse files Browse the repository at this point in the history
…stenLabs#5662)

`sui::table::new` takes a TxContext as an argument.  The `ctx` is a little out-of-context (pun intended) here but it is a commonly used abbreviation for `TxContext`, so hopefully helps communicate that the `TxContext` argument is required.
  • Loading branch information
jaredcosulich authored Nov 2, 2022
1 parent 48a8f00 commit 0370b3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/src/build/programming-with-objects/ch6-collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ that can only be called for tables where the value type also has `drop`, which a
Equality on collections is based on identity, i.e. an instance of a collection type is only considered equal to itself and not to all collections that hold the same entries:

```rust
let t1 = sui::table::new<u64, u64>();
let t2 = sui::table::new<u64, u64>();
let t1 = sui::table::new<u64, u64>(ctx);
let t2 = sui::table::new<u64, u64>(ctx);

assert!(&t1 == &t1, 0);
assert!(&t1 != &t2, 1);
Expand Down

0 comments on commit 0370b3b

Please sign in to comment.