Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 2_intro_to_generics.md #58

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading