From d966750535343240e8c18606cf43826c5b8bb3f6 Mon Sep 17 00:00:00 2001 From: Nicole L Date: Fri, 12 Apr 2024 08:15:46 -0700 Subject: [PATCH] Uncomment setter in generics example (#1978) I don't think it helps to have the example of a setter commented out in the example. Uncommenting it and implementing it normally is more clear. --- src/generics/generic-data.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/generics/generic-data.md b/src/generics/generic-data.md index 87245249..35ba2e34 100644 --- a/src/generics/generic-data.md +++ b/src/generics/generic-data.md @@ -18,7 +18,9 @@ impl Point { (&self.x, &self.y) } - // fn set_x(&mut self, x: T) + fn set_x(&mut self, x: T) { + self.x = x; + } } fn main() {