From 3b5d43ecb28d4846e4f5d16b3fa68ab63fd776c9 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Fri, 3 Sep 2021 00:20:38 +0200 Subject: [PATCH] cleanup --- src/components/revision_files.rs | 12 ++++-------- src/strings.rs | 3 +++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/revision_files.rs b/src/components/revision_files.rs index b06538cc..4a36bbd0 100644 --- a/src/components/revision_files.rs +++ b/src/components/revision_files.rs @@ -6,7 +6,7 @@ use super::{ use crate::{ keys::SharedKeyConfig, queue::{InternalEvent, Queue}, - strings::{self, order}, + strings::{self, order, symbol}, ui::{self, common_nav, style::SharedTheme}, AsyncAppNotification, AsyncNotification, }; @@ -27,10 +27,6 @@ use tui::{ Frame, }; -const FOLDER_ICON_COLLAPSED: &str = "\u{25b8}"; //▸ -const FOLDER_ICON_EXPANDED: &str = "\u{25be}"; //▾ -const EMPTY_STR: &str = ""; - enum Focus { Tree, File, @@ -117,12 +113,12 @@ impl RevisionFilesComponent { let is_path = item.kind().is_path(); let path_arrow = if is_path { if item.kind().is_path_collapsed() { - FOLDER_ICON_COLLAPSED + symbol::FOLDER_ICON_COLLAPSED } else { - FOLDER_ICON_EXPANDED + symbol::FOLDER_ICON_EXPANDED } } else { - EMPTY_STR + symbol::EMPTY_STR }; let path = format!("{}{}{}", indent_str, path_arrow, path); diff --git a/src/strings.rs b/src/strings.rs index 8d3ed500..7d6e0924 100644 --- a/src/strings.rs +++ b/src/strings.rs @@ -27,6 +27,9 @@ pub mod symbol { pub const CHECKMARK: &str = "\u{2713}"; //✓ pub const SPACE: &str = "\u{02FD}"; //˽ pub const EMPTY_SPACE: &str = " "; + pub const FOLDER_ICON_COLLAPSED: &str = "\u{25b8}"; //▸ + pub const FOLDER_ICON_EXPANDED: &str = "\u{25be}"; //▾ + pub const EMPTY_STR: &str = ""; } pub fn title_branches() -> String {