From bd6154fbf56041b57e8c3bc9d8a7bef645c7c9cb Mon Sep 17 00:00:00 2001 From: nyx Date: Fri, 4 Oct 2024 06:10:41 -0400 Subject: [PATCH] run fmt --- tui/src/floating_text.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tui/src/floating_text.rs b/tui/src/floating_text.rs index 8e9efeb8..03d174ff 100644 --- a/tui/src/floating_text.rs +++ b/tui/src/floating_text.rs @@ -148,11 +148,9 @@ impl FloatingText { pub fn from_command(command: &Command, mode: FloatingTextMode) -> Option { let src = match command { Command::Raw(cmd) => Some(cmd.clone()), - Command::LocalFile { file, .. } => { - std::fs::read_to_string(file) - .map_err(|_| format!("File not found: {:?}", file)) - .ok() - } + Command::LocalFile { file, .. } => std::fs::read_to_string(file) + .map_err(|_| format!("File not found: {:?}", file)) + .ok(), Command::None => None, }?; @@ -216,7 +214,9 @@ impl FloatingText { .into_iter() .map(|cow| cow.into_owned()) .collect(), - _ => get_lines_owned(&get_highlighted_string(&self.src).unwrap_or(self.src.clone())), + _ => { + get_lines_owned(&get_highlighted_string(&self.src).unwrap_or(self.src.clone())) + } }; } } @@ -238,7 +238,7 @@ impl FloatContent for FloatingText { // Calculate the inner area to ensure text is not drawn over the border let inner_area = block.inner(area); let Rect { width, height, .. } = inner_area; - + self.update_wrapping(width as usize); let lines = self