@@ -24,7 +24,7 @@ pub fn main(config: &GpioConfig, opts: &GpioStatusOptions) {
24
24
} ;
25
25
print_pin_header ( ) ;
26
26
print_pin_row ( & pin_config, true ) ;
27
- } ,
27
+ }
28
28
None => {
29
29
print_pin_header ( ) ;
30
30
for ( pos, pin) in config. get_pins ( ) . iter ( ) . enumerate ( ) {
@@ -35,20 +35,24 @@ pub fn main(config: &GpioConfig, opts: &GpioStatusOptions) {
35
35
}
36
36
37
37
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" ,
45
45
"Value" ) ;
46
46
print_row_sep ( false ) ;
47
47
}
48
48
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}" ,
52
56
col_sep,
53
57
col_sep,
54
58
col_sep,
@@ -58,7 +62,7 @@ fn print_row_sep(is_last: bool){
58
62
col_sep) ;
59
63
}
60
64
61
- fn print_pin_row ( pin_config : & PinConfig , is_last : bool ) {
65
+ fn print_pin_row ( pin_config : & PinConfig , is_last : bool ) {
62
66
let direction = match pin_config. direction {
63
67
Direction :: In => "In" ,
64
68
Direction :: Out => "Out" ,
@@ -71,25 +75,25 @@ fn print_pin_row(pin_config: &PinConfig, is_last: bool){
71
75
Err ( e) => {
72
76
println ! ( "ERROR: {:?}" , e) ;
73
77
exit ( 1 ) ;
74
- } ,
78
+ }
75
79
} ;
76
80
77
81
for ( pos, name) in pin_config. names . iter ( ) . enumerate ( ) {
78
82
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,
85
89
value) ;
86
90
} 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,
93
97
"" ) ;
94
98
95
99
}
0 commit comments