Skip to content

Commit

Permalink
Merge pull request #58 from georgescharlesbrain/patch-11
Browse files Browse the repository at this point in the history
Update 2_intro_to_generics.md
  • Loading branch information
uvd authored Oct 26, 2023
2 parents c45cc02 + 242887f commit 9ab290a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unit-three/lessons/2_intro_to_generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module generics::storage {
}
```

However, this type will only be able to hold a value of type `u64`, to make our `Box` able to hold any generic type, we will need to use generics. The code would be modified as following:
However, this type will only be able to hold a value of type `u64`. To make our `Box` able to hold any generic type, we will need to use generics. The code would be modified as follows:

```rust
module generics::storage {
Expand Down Expand Up @@ -73,7 +73,7 @@ This will only accept inputs of the type `u64` for the `create_box` method, whil

#### Calling Functions with Generics

To call a function with a signature that contains generics, we must specify the type in square brackets, as in the following syntax:
To call a function with a signature that contains generics, we must specify the type in angle brackets, as in the following syntax:

```rust
// value will be of type storage::Box<bool>
Expand Down

0 comments on commit 9ab290a

Please sign in to comment.