diff options
| author | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-10-25 10:21:38 +0200 |
|---|---|---|
| committer | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-10-25 10:21:38 +0200 |
| commit | 17d76ba4051e414170fb0ed9c7370472cb761bef (patch) | |
| tree | b17ce916f980121fdfbabc8401ddf0fdbae2aa63 /src/border.rs | |
| parent | feat: implement border (diff) | |
| download | sl0pstatus-17d76ba4051e414170fb0ed9c7370472cb761bef.tar.gz sl0pstatus-17d76ba4051e414170fb0ed9c7370472cb761bef.tar.xz sl0pstatus-17d76ba4051e414170fb0ed9c7370472cb761bef.zip | |
chore: refactor border rendering
Diffstat (limited to '')
| -rw-r--r-- | src/border.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/border.rs b/src/border.rs index d1213b8..587a058 100644 --- a/src/border.rs +++ b/src/border.rs @@ -30,19 +30,8 @@ impl Default for BorderConfig { } impl BorderConfig { - pub fn draw_if_enabled(&self, cols: usize) { - if !self.enabled { - return; - } - - let output = self.char.repeat(cols); - - let mut newline = ""; - if self.position == BorderPosition::Top { - newline = "\n"; - } - - print!("{}{}", self.format.format_string(output), newline); + pub fn draw(&self, cols: usize) -> String { + self.format.format_string(self.char.repeat(cols)) } } |
