Fix borrowing code smells

This commit is contained in:
Victor Song 2022-09-30 23:20:01 -04:00
parent 1f409793ae
commit 7c1878f0e4
4 changed files with 6 additions and 6 deletions

View File

@ -221,13 +221,13 @@ impl<'dir> File<'dir> {
path.to_path_buf() path.to_path_buf()
} }
else if let Some(dir) = self.parent_dir { else if let Some(dir) = self.parent_dir {
dir.join(&*path) dir.join(path)
} }
else if let Some(parent) = self.path.parent() { else if let Some(parent) = self.path.parent() {
parent.join(&*path) parent.join(path)
} }
else { else {
self.path.join(&*path) self.path.join(path)
} }
} }

View File

@ -161,7 +161,7 @@ impl<'a> Render<'a> {
(None, _) => {/* Keep Git how it is */}, (None, _) => {/* Keep Git how it is */},
} }
let mut table = Table::new(table, self.git, &self.theme); let mut table = Table::new(table, self.git, self.theme);
if self.opts.header { if self.opts.header {
let header = table.header_row(); let header = table.header_row();

View File

@ -202,7 +202,7 @@ impl<'a> Render<'a> {
(None, _) => {/* Keep Git how it is */}, (None, _) => {/* Keep Git how it is */},
} }
let mut table = Table::new(options, self.git, &self.theme); let mut table = Table::new(options, self.git, self.theme);
let mut rows = Vec::new(); let mut rows = Vec::new();
if self.details.header { if self.details.header {

View File

@ -87,7 +87,7 @@ fn default_zoned(time: SystemTime, zone: &TimeZone) -> String {
} }
fn get_dateformat(date: &LocalDateTime) -> &'static DateFormat<'static> { fn get_dateformat(date: &LocalDateTime) -> &'static DateFormat<'static> {
match (is_recent(&date), *MAXIMUM_MONTH_WIDTH) { match (is_recent(date), *MAXIMUM_MONTH_WIDTH) {
(true, 4) => &FOUR_WIDE_DATE_TIME, (true, 4) => &FOUR_WIDE_DATE_TIME,
(true, 5) => &FIVE_WIDE_DATE_TIME, (true, 5) => &FIVE_WIDE_DATE_TIME,
(true, _) => &OTHER_WIDE_DATE_TIME, (true, _) => &OTHER_WIDE_DATE_TIME,