From 056505d89fb63d3a748b91a4b6c12ce83dccb9a3 Mon Sep 17 00:00:00 2001 From: LukeMathWalker <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:10:50 +0200 Subject: [PATCH] It's enough for one field to be private. Closes #69 --- book/src/03_ticket_v1/05_encapsulation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/src/03_ticket_v1/05_encapsulation.md b/book/src/03_ticket_v1/05_encapsulation.md index 17c249d..55557e4 100644 --- a/book/src/03_ticket_v1/05_encapsulation.md +++ b/book/src/03_ticket_v1/05_encapsulation.md @@ -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 -- 2.45.2