mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 14:57:14 +00:00
commit
7aa7707af9
@ -182,7 +182,7 @@ and with a struct, we have actual names.
|
|||||||
|
|
||||||
There _is_ one case when a tuple struct is very useful, though, and that's a
|
There _is_ one case when a tuple struct is very useful, though, and that's a
|
||||||
tuple struct with only one element. We call this a *newtype*, because it lets
|
tuple struct with only one element. We call this a *newtype*, because it lets
|
||||||
you create a new type that's a synonym for another one:
|
you create a new type that's similar to another one:
|
||||||
|
|
||||||
```{rust}
|
```{rust}
|
||||||
struct Inches(i32);
|
struct Inches(i32);
|
||||||
|
Loading…
Reference in New Issue
Block a user