From baedc39494ea70292b1d247934420a20d0544b7e Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Fri, 3 May 2024 01:32:52 +0200 Subject: [PATCH] refactor(buffer): simplify set_stringn logic (#1083) --- src/buffer/buffer.rs | 75 ++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 45 deletions(-) diff --git a/src/buffer/buffer.rs b/src/buffer/buffer.rs index 6204b845..8f504729 100644 --- a/src/buffer/buffer.rs +++ b/src/buffer/buffer.rs @@ -1,8 +1,3 @@ -use std::{ - cmp::min, - fmt::{Debug, Formatter, Result}, -}; - use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; @@ -186,65 +181,56 @@ impl Buffer { } /// Print a string, starting at the position (x, y) - /// - /// `style` accepts any type that is convertible to [`Style`] (e.g. [`Style`], [`Color`], or - /// your own type that implements [`Into