mirror of
https://github.com/mainmatter/100-exercises-to-learn-rust
synced 2024-11-16 19:50:44 +01:00
It's enough for one field to be private. Closes #69
This commit is contained in:
parent
b039a6c5c2
commit
056505d89f
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ To enforce stricter rules, we must keep the fields private[^newtype].
|
|||
We can then provide public methods to interact with a `Ticket` instance.
|
||||
Those public methods will have the responsibility of upholding our invariants (e.g. a title must not be empty).
|
||||
|
||||
If all fields are private, it is no longer possible to create a `Ticket` instance directly using the struct
|
||||
If at least one field is private it is no longer possible to create a `Ticket` instance directly using the struct
|
||||
instantiation syntax:
|
||||
|
||||
```rust
|
||||
|
|
Loading…
Reference in a new issue