Skip to content

Commit afb781e

Browse files
committed
Fix clippy::derivable_impls
1 parent 6505de9 commit afb781e

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

tree/ls_util/entry.rs

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ impl Entry {
464464
}
465465
}
466466

467-
// Used for padding in long format
467+
/// Used for padding in long format
468+
#[derive(Default)]
468469
pub struct LongFormatPadding {
469470
pub blocks_str_width: usize,
470471
pub inode_str_width: usize,
@@ -477,22 +478,6 @@ pub struct LongFormatPadding {
477478
pub time_width: usize,
478479
}
479480

480-
impl Default for LongFormatPadding {
481-
fn default() -> Self {
482-
Self {
483-
blocks_str_width: 0,
484-
inode_str_width: 0,
485-
num_links_width: 0,
486-
owner_name_width: 0,
487-
group_name_width: 0,
488-
file_size_width: 0,
489-
device_id_major_width: 0,
490-
device_id_minor_width: 0,
491-
time_width: 0,
492-
}
493-
}
494-
}
495-
496481
impl LongFormatPadding {
497482
/// Get the maximum padding for each field.
498483
pub fn update_maximum(&mut self, other: &LongFormatPadding) {
@@ -525,25 +510,15 @@ impl LongFormatPadding {
525510
}
526511
}
527512

528-
// Used for padding in multi-column format
513+
/// Used for padding in multi-column format
514+
#[derive(Default)]
529515
pub struct MultiColumnPadding {
530516
pub total_width: usize,
531517
pub inode_str_width: usize,
532518
pub blocks_str_width: usize,
533519
pub file_name_width: usize,
534520
}
535521

536-
impl Default for MultiColumnPadding {
537-
fn default() -> Self {
538-
Self {
539-
total_width: 0,
540-
inode_str_width: 0,
541-
blocks_str_width: 0,
542-
file_name_width: 0,
543-
}
544-
}
545-
}
546-
547522
impl MultiColumnPadding {
548523
pub fn update_maximum(&mut self, other: &MultiColumnPadding) {
549524
self.total_width = usize::max(self.total_width, other.total_width);

users/talk.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ pub struct Osockaddr {
207207
pub sa_data: [u8; 14],
208208
}
209209

210+
#[allow(clippy::derivable_impls)]
210211
impl Default for Osockaddr {
211212
fn default() -> Self {
212213
Osockaddr {

0 commit comments

Comments
 (0)