From 852cd5f0b92da4fc240c1097c99b8085427fe856 Mon Sep 17 00:00:00 2001 From: daviddoji Date: Sun, 23 Jun 2024 17:58:03 +0200 Subject: [PATCH] solution to exercise 03_05 --- exercises/03_ticket_v1/05_encapsulation/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/exercises/03_ticket_v1/05_encapsulation/src/lib.rs b/exercises/03_ticket_v1/05_encapsulation/src/lib.rs index 91e06eb..e59d18d 100644 --- a/exercises/03_ticket_v1/05_encapsulation/src/lib.rs +++ b/exercises/03_ticket_v1/05_encapsulation/src/lib.rs @@ -34,6 +34,17 @@ pub mod ticket { // - `title` that returns the `title` field. // - `description` that returns the `description` field. // - `status` that returns the `status` field. + pub fn title(self) -> String { + self.title + } + + pub fn description(self) -> String { + self.description + } + + pub fn status(self) -> String { + self.status + } } }