mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 19:14:32 -06:00
Correct code example to illustrate generics
This commit is contained in:
@@ -146,8 +146,8 @@ imagine we had a function that wanted to call `print` for any type that supports
|
||||
printing. We could write it like this:
|
||||
|
||||
```rust,ignore
|
||||
fn print(value: v) {
|
||||
v.print();
|
||||
fn print<T>(value: T) {
|
||||
value.print();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user