diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-12-04 21:50:46 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-12-04 21:51:16 +0100 |
commit | 7c7bdcf711f4fdb6a3a02470d0df6e899ca1690b (patch) | |
tree | c02c8bb4c0e2898f95006df5af191e36f450de22 | |
parent | 51fdb941249757115599fa13ca9779cce549bdc0 (diff) |
use Rc instead of owned string in ColoredTriplet
-rw-r--r-- | src/modes/display/preview.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modes/display/preview.rs b/src/modes/display/preview.rs index c374c22..ef8c386 100644 --- a/src/modes/display/preview.rs +++ b/src/modes/display/preview.rs @@ -1118,9 +1118,9 @@ macro_rules! impl_window { }; } -/// A tuple with `(ColoredString, String, ColoredString)`. +/// A tuple with `(String, std::rc::Rc<str>, ColoredString)`. /// Used to iter and impl window trait in tree mode. -pub type ColoredTriplet = (String, String, ColoredString); +pub type ColoredTriplet = (String, std::rc::Rc<str>, ColoredString); pub trait MakeTriplet { fn make( @@ -1140,10 +1140,10 @@ impl MakeTriplet for ColoredTriplet { filename_text: String, color_effect: ColorEffect, current_path: &std::path::Path, - ) -> ColoredTriplet { + ) -> Self { ( fileinfo.format_no_filename().unwrap_or_default(), - prefix.to_owned(), + std::rc::Rc::from(prefix), ColoredString::new(filename_text, color_effect, std::rc::Rc::from(current_path)), ) } |