Skip to content

Commit 20f4b58

Browse files
committed
status: cargo-fmt
There was a fair amount of trailing whitespace and some other issues. Signed-off-by: Paul Osborne <[email protected]>
1 parent 95ef6ab commit 20f4b58

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

src/commands/gpio_status.rs

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn main(config: &GpioConfig, opts: &GpioStatusOptions) {
2424
};
2525
print_pin_header();
2626
print_pin_row(&pin_config, true);
27-
},
27+
}
2828
None => {
2929
print_pin_header();
3030
for (pos, pin) in config.get_pins().iter().enumerate() {
@@ -35,20 +35,24 @@ pub fn main(config: &GpioConfig, opts: &GpioStatusOptions) {
3535
}
3636

3737

38-
fn print_pin_header(){
39-
println!("| {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |",
40-
"Number",
41-
"Exported",
42-
"Direction",
43-
"Active Low",
44-
"Names",
38+
fn print_pin_header() {
39+
println!("| {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |",
40+
"Number",
41+
"Exported",
42+
"Direction",
43+
"Active Low",
44+
"Names",
4545
"Value");
4646
print_row_sep(false);
4747
}
4848

49-
fn print_row_sep(is_last: bool){
50-
let col_sep = if is_last {"-"} else {"+"};
51-
println!("{}{:->13}{:->13}{:->13}{:->13}{:->13}{:->13}",
49+
fn print_row_sep(is_last: bool) {
50+
let col_sep = if is_last {
51+
"-"
52+
} else {
53+
"+"
54+
};
55+
println!("{}{:->13}{:->13}{:->13}{:->13}{:->13}{:->13}",
5256
col_sep,
5357
col_sep,
5458
col_sep,
@@ -58,7 +62,7 @@ fn print_row_sep(is_last: bool){
5862
col_sep);
5963
}
6064

61-
fn print_pin_row(pin_config: &PinConfig, is_last: bool){
65+
fn print_pin_row(pin_config: &PinConfig, is_last: bool) {
6266
let direction = match pin_config.direction {
6367
Direction::In => "In",
6468
Direction::Out => "Out",
@@ -71,25 +75,25 @@ fn print_pin_row(pin_config: &PinConfig, is_last: bool){
7175
Err(e) => {
7276
println!("ERROR: {:?}", e);
7377
exit(1);
74-
},
78+
}
7579
};
7680

7781
for (pos, name) in pin_config.names.iter().enumerate() {
7882
if pos == 0 {
79-
println!("| {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |",
80-
pin_config.num,
81-
pin_config.export,
82-
direction,
83-
pin_config.active_low,
84-
name,
83+
println!("| {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |",
84+
pin_config.num,
85+
pin_config.export,
86+
direction,
87+
pin_config.active_low,
88+
name,
8589
value);
8690
} else {
87-
println!("| {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |",
88-
"",
89-
"",
90-
"",
91-
"",
92-
name,
91+
println!("| {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |",
92+
"",
93+
"",
94+
"",
95+
"",
96+
name,
9397
"");
9498

9599
}

0 commit comments

Comments
 (0)