mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-15 06:22:47 +00:00
Lint everything
This commit is contained in:
parent
8bc324ccc7
commit
deb03c5c53
3 changed files with 6 additions and 6 deletions
|
@ -37,7 +37,7 @@ impl Batch {
|
|||
let mut res = Vec::with_capacity(self.0.len());
|
||||
|
||||
for meta in &self.0 {
|
||||
let icon = icons.from_name(&meta.name);
|
||||
let icon = icons.get(&meta.name);
|
||||
|
||||
let strings: &[ANSIString] = &[icon.render(colors), meta.name.render(colors)];
|
||||
|
||||
|
@ -55,7 +55,7 @@ impl Batch {
|
|||
let (max_size_value_length, max_size_unit_length) = self.detect_size_lenghts();
|
||||
|
||||
for meta in &self.0 {
|
||||
let icon = icons.from_name(&meta.name);
|
||||
let icon = icons.get(&meta.name);
|
||||
|
||||
let strings: &[ANSIString] = &[
|
||||
meta.file_type.render(colors),
|
||||
|
|
|
@ -2,7 +2,7 @@ use color::{ColoredString, Colors, Elem};
|
|||
use meta::{FileType, Name};
|
||||
use std::collections::HashMap;
|
||||
|
||||
const ICON_SPACE: &'static str = " ";
|
||||
const ICON_SPACE: &str = " ";
|
||||
|
||||
pub struct Icon {
|
||||
icon: &'static str,
|
||||
|
@ -38,7 +38,7 @@ impl Icons {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn from_name(&self, name: &Name) -> Icon {
|
||||
pub fn get(&self, name: &Name) -> Icon {
|
||||
// Check the known names.
|
||||
if let Some(res) = self.icons_by_name.get(name.name().as_str()) {
|
||||
return Icon {
|
||||
|
|
|
@ -35,10 +35,10 @@ impl<'a> From<&'a Path> for SymLink {
|
|||
};
|
||||
}
|
||||
|
||||
return SymLink {
|
||||
SymLink {
|
||||
target: None,
|
||||
valid: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue