mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
join: fix code formatting
This commit is contained in:
parent
128a38965e
commit
186cb8853f
1 changed files with 12 additions and 11 deletions
|
@ -15,7 +15,7 @@ extern crate clap;
|
||||||
extern crate uucore;
|
extern crate uucore;
|
||||||
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::{BufRead, BufReader, Lines, Stdin, stdin};
|
use std::io::{stdin, BufRead, BufReader, Lines, Stdin};
|
||||||
use std::cmp::{min, Ordering};
|
use std::cmp::{min, Ordering};
|
||||||
use clap::{App, Arg};
|
use clap::{App, Arg};
|
||||||
|
|
||||||
|
@ -71,7 +71,11 @@ struct Repr<'a> {
|
||||||
|
|
||||||
impl<'a> Repr<'a> {
|
impl<'a> Repr<'a> {
|
||||||
fn new(separator: char, format: &'a [Spec], empty: &'a str) -> Repr<'a> {
|
fn new(separator: char, format: &'a [Spec], empty: &'a str) -> Repr<'a> {
|
||||||
Repr { separator, format, empty }
|
Repr {
|
||||||
|
separator,
|
||||||
|
format,
|
||||||
|
empty,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn uses_format(&self) -> bool {
|
fn uses_format(&self) -> bool {
|
||||||
|
@ -79,8 +83,7 @@ impl<'a> Repr<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Print the field or empty filler if the field is not set.
|
/// Print the field or empty filler if the field is not set.
|
||||||
fn print_field(&self, field: Option<&str>)
|
fn print_field(&self, field: Option<&str>) {
|
||||||
{
|
|
||||||
let value = match field {
|
let value = match field {
|
||||||
Some(field) => field,
|
Some(field) => field,
|
||||||
None => self.empty,
|
None => self.empty,
|
||||||
|
@ -408,12 +411,10 @@ FILENUM is 1 or 2, corresponding to FILE1 or FILE2"))
|
||||||
|
|
||||||
let mut settings: Settings = Default::default();
|
let mut settings: Settings = Default::default();
|
||||||
settings.print_unpaired = match matches.value_of("a") {
|
settings.print_unpaired = match matches.value_of("a") {
|
||||||
Some(value) => {
|
Some(value) => match value {
|
||||||
match value {
|
"1" => FileNum::File1,
|
||||||
"1" => FileNum::File1,
|
"2" => FileNum::File2,
|
||||||
"2" => FileNum::File2,
|
value => crash!(1, "invalid file number: '{}'", value),
|
||||||
value => crash!(1, "invalid file number: '{}'", value),
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
None => FileNum::None,
|
None => FileNum::None,
|
||||||
};
|
};
|
||||||
|
@ -560,6 +561,6 @@ fn compare(field1: Option<&str>, field2: Option<&str>, ignore_case: bool) -> Ord
|
||||||
None => match field2 {
|
None => match field2 {
|
||||||
Some(_) => Ordering::Less,
|
Some(_) => Ordering::Less,
|
||||||
None => Ordering::Equal,
|
None => Ordering::Equal,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue