Skip to content

Commit

Permalink
Code cleanup reducing clones (in theory)
Browse files Browse the repository at this point in the history
  • Loading branch information
rben01 authored and sharkdp committed Sep 29, 2024
1 parent 6cc1dc3 commit f3fba19
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions numbat/src/markup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit f3fba19

Please sign in to comment.