From 00653c772e7df6f68071d1cb1c92bfe9ca4876f9 Mon Sep 17 00:00:00 2001 From: Mo Date: Tue, 27 Feb 2024 18:24:05 +0100 Subject: Avoid cloning the whole paragraph content just for rendering (#9739) * Avoid cloning the whole paragraph content just for rendering * Fix tests--- helix-term/src/ui/text.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helix-term/src/ui/text.rs') diff --git a/helix-term/src/ui/text.rs b/helix-term/src/ui/text.rs index a379536f..a9c99562 100644 --- a/helix-term/src/ui/text.rs +++ b/helix-term/src/ui/text.rs @@ -33,7 +33,7 @@ impl Component for Text { fn render(&mut self, area: Rect, surface: &mut Surface, _cx: &mut Context) { use tui::widgets::{Paragraph, Widget, Wrap}; - let par = Paragraph::new(self.contents.clone()).wrap(Wrap { trim: false }); + let par = Paragraph::new(&self.contents).wrap(Wrap { trim: false }); // .scroll(x, y) offsets par.render(area, surface); -- cgit v1.2.3-70-g09d2