From 79adfff37048f33e9f16bb8123855fb876269f9e Mon Sep 17 00:00:00 2001 From: dvvvvvv Date: Sun, 2 Feb 2020 22:55:44 +0900 Subject: [PATCH] remove name property from Name struct --- src/color.rs | 5 +++-- src/core.rs | 2 +- src/icon.rs | 33 +++++++++++++-------------- src/meta/mod.rs | 18 ++++++++------- src/meta/name.rs | 58 +++++++++++++++++++++++++----------------------- 5 files changed, 60 insertions(+), 56 deletions(-) diff --git a/src/color.rs b/src/color.rs index 943a1d0..3b66322 100644 --- a/src/color.rs +++ b/src/color.rs @@ -1,6 +1,7 @@ use ansi_term::{ANSIString, Colour, Style}; use lscolors::{Indicator, LsColors}; use std::collections::HashMap; +use std::path::Path; #[allow(dead_code)] #[derive(Hash, Debug, Eq, PartialEq, Clone)] @@ -96,7 +97,7 @@ impl Colors { pub fn colorize_using_path<'a>( &self, input: String, - path: &str, + path: &Path, elem: &Elem, ) -> ColoredString<'a> { let style_from_path = self.style_from_path(path); @@ -106,7 +107,7 @@ impl Colors { } } - fn style_from_path(&self, path: &str) -> Option