Skip to content

Commit 46216dd

Browse files
authored
Merge pull request #273 from fox0/clippy--enum_variant_names
Fix clippy::enum_variant_names
2 parents f827d7b + 89a2ef5 commit 46216dd

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

file/file.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ struct Args {
7070
}
7171

7272
/// Errors that can occur during parsing of a raw magic line.
73+
#[allow(clippy::enum_variant_names)]
7374
#[derive(Debug)]
7475
enum RawMagicLineParseError {
7576
/// Indicates that the offset format is invalid.

tree/ls.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ struct LongFormatOptions {
296296
enum OutputFormat {
297297
MultiColumn,
298298
MultiColumnAcross,
299-
StreamOutputFormat,
299+
Stream,
300300
OneEntryPerLine,
301-
LongFormat(LongFormatOptions),
301+
Long(LongFormatOptions),
302302
}
303303

304304
enum SortBy {
@@ -320,6 +320,7 @@ enum DereferenceSymbolicLink {
320320
None,
321321
}
322322

323+
#[allow(clippy::enum_variant_names)]
323324
enum FileTimeOption {
324325
LastModificationTime,
325326
LastStatusChangeTime,
@@ -451,7 +452,7 @@ impl Config {
451452
) {
452453
(false, false, false, false) => {
453454
if long_format_enabled {
454-
OutputFormat::LongFormat(long_format_options)
455+
OutputFormat::Long(long_format_options)
455456
} else {
456457
// According to the specification:
457458
//
@@ -464,7 +465,7 @@ impl Config {
464465
}
465466
}
466467
(true, false, false, false) => OutputFormat::MultiColumn,
467-
(false, true, false, false) => OutputFormat::StreamOutputFormat,
468+
(false, true, false, false) => OutputFormat::Stream,
468469
(false, false, true, false) => OutputFormat::MultiColumnAcross,
469470
(false, false, false, true) => OutputFormat::OneEntryPerLine,
470471
_ => unreachable!(), // -C, -m, -x, and -1 are mutually exclusive
@@ -718,7 +719,7 @@ fn display_entries(entries: &mut [Entry], config: &Config, dir_path: Option<&str
718719
}
719720

720721
let mut display_total_size = config.display_size;
721-
if let OutputFormat::LongFormat(_) = &config.output_format {
722+
if let OutputFormat::Long(_) = &config.output_format {
722723
display_total_size = true;
723724
}
724725

@@ -743,7 +744,7 @@ fn display_entries(entries: &mut [Entry], config: &Config, dir_path: Option<&str
743744
}
744745

745746
match &config.output_format {
746-
OutputFormat::LongFormat(_) => {
747+
OutputFormat::Long(_) => {
747748
let mut padding = LongFormatPadding::default();
748749

749750
// Calculate required padding
@@ -829,7 +830,7 @@ fn display_entries(entries: &mut [Entry], config: &Config, dir_path: Option<&str
829830
println!();
830831
}
831832
}
832-
OutputFormat::StreamOutputFormat => {
833+
OutputFormat::Stream => {
833834
let stream_outputs: Vec<_> = entries
834835
.iter()
835836
.map(|entry| entry.build_stream_mode_string())
@@ -962,7 +963,7 @@ fn ls(paths: Vec<PathBuf>, config: &Config) -> io::Result<u8> {
962963
let target_path = {
963964
let mut target_path = None;
964965
if metadata.is_symlink() && !dereference_symlink {
965-
if let OutputFormat::LongFormat(_) = &config.output_format {
966+
if let OutputFormat::Long(_) = &config.output_format {
966967
let mut buf = vec![0u8; libc::PATH_MAX as usize];
967968

968969
let path_cstr = CString::new(path.as_os_str().as_bytes()).unwrap();
@@ -1174,7 +1175,7 @@ fn process_single_dir(
11741175

11751176
let mut target_path = None;
11761177
if metadata.is_symlink() && !dereference_symlink {
1177-
if let OutputFormat::LongFormat(_) = &config.output_format {
1178+
if let OutputFormat::Long(_) = &config.output_format {
11781179
target_path = Some(ls_from_utf8_lossy(
11791180
dir_entry.read_link().unwrap().to_bytes(),
11801181
));

tree/ls_util/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl Entry {
8080
};
8181

8282
let long_format_data =
83-
if let OutputFormat::LongFormat(long_format_options) = &config.output_format {
83+
if let OutputFormat::Long(long_format_options) = &config.output_format {
8484
Some(LongFormatData::new(metadata, long_format_options)?)
8585
} else {
8686
None

0 commit comments

Comments
 (0)