From e0d7b0660d5750466fbffbef9178aa9d9e39b677 Mon Sep 17 00:00:00 2001 From: Myles Wirth Date: Sat, 3 Jan 2026 21:12:09 -0500 Subject: [PATCH] Broke out some UI code --- src/main.rs | 24 +++--------------------- src/ui.rs | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 src/ui.rs diff --git a/src/main.rs b/src/main.rs index 1cc0c79..0988876 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,27 +12,9 @@ use serde::{Deserialize, de::DeserializeSeed}; use url::Url; use walkdir::WalkDir; -const REGULAR_SET: Set = Set { - top_left: "▛", - top_right: "▜", - bottom_left: "▔", - bottom_right: "▔", - vertical_left: "▏", - vertical_right: "▕", - horizontal_top: "▔", - horizontal_bottom: "▔", -}; - -const WONKY_SET: Set = Set { - top_left: "╭", - top_right: "╮", - bottom_left: "▔", - bottom_right: "▔", - vertical_left: "║", - vertical_right: "║", - horizontal_top: "═", - horizontal_bottom: "▔", -}; +use crate::ui::{REGULAR_SET, WONKY_SET}; + +mod ui; fn deserialize_name<'de, D>(deserializer: D) -> Result, D::Error> where diff --git a/src/ui.rs b/src/ui.rs new file mode 100644 index 0000000..ecf1fc0 --- /dev/null +++ b/src/ui.rs @@ -0,0 +1,23 @@ +use ratatui::symbols::border::Set; + +pub const REGULAR_SET: Set = Set { + top_left: "▛", + top_right: "▜", + bottom_left: "▔", + bottom_right: "▔", + vertical_left: "▏", + vertical_right: "▕", + horizontal_top: "▔", + horizontal_bottom: "▔", +}; + +pub const WONKY_SET: Set = Set { + top_left: "╭", + top_right: "╮", + bottom_left: "▔", + bottom_right: "▔", + vertical_left: "║", + vertical_right: "║", + horizontal_top: "═", + horizontal_bottom: "▔", +}; -- 2.51.2