From f3fba196bece9af47bb1ea5c8137ae9f1869e973 Mon Sep 17 00:00:00 2001 From: Robert Bennett Date: Sat, 28 Sep 2024 12:22:02 -0400 Subject: [PATCH] Code cleanup reducing clones (in theory) --- numbat/src/markup.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/numbat/src/markup.rs b/numbat/src/markup.rs index e2f5f342..84941254 100644 --- a/numbat/src/markup.rs +++ b/numbat/src/markup.rs @@ -43,10 +43,9 @@ impl Display for Markup { impl std::ops::Add for Markup { type Output = Markup; - fn add(self, rhs: Self) -> Self::Output { - let mut res = self.0; - res.extend_from_slice(&rhs.0); - Markup(res) + fn add(mut self, rhs: Self) -> Self::Output { + self.0.extend(rhs.0); + self } }