From 147c3eaf92afe0c1c6c89d44d3b0f0f28e5c9c72 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sun, 25 Sep 2022 19:47:04 +0200 Subject: [PATCH] Clean up use of Size --- src/main.rs | 1 - src/ui/widgets/editor.rs | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9b99d3e..2b6c09a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,6 @@ #![warn(clippy::use_self)] // TODO Enable warn(unreachable_pub)? -// TODO Clean up use and manipulation of toss Pos and Size // TODO Remove unnecessary Debug impls and compare compile times mod config; diff --git a/src/ui/widgets/editor.rs b/src/ui/widgets/editor.rs index 1aecd93..8de6cf0 100644 --- a/src/ui/widgets/editor.rs +++ b/src/ui/widgets/editor.rs @@ -497,11 +497,7 @@ impl Editor { impl Widget for Editor { fn size(&self, frame: &mut Frame, max_width: Option, max_height: Option) -> Size { if let Some(placeholder) = &self.hidden { - let mut size = if self.text.text().is_empty() { - Size::new(1, 1) - } else { - placeholder.size(frame, max_width, max_height) - }; + let mut size = placeholder.size(frame, max_width, max_height); // Cursor needs to fit regardless of focus size.width = size.width.max(1);