@@ -45,12 +45,6 @@ fn run() -> Result<()> {
45
45
46
46
let matches = app:: build_app ( ) . get_matches_from ( env:: args_os ( ) ) ;
47
47
48
- let excluded: Vec < String > = if let Some ( user_ignored) = matches. values_of ( "exclude" ) {
49
- user_ignored. map ( String :: from) . collect ( )
50
- } else {
51
- Vec :: new ( )
52
- } ;
53
-
54
48
if matches. is_present ( "languages" ) {
55
49
let iterator = Language :: iter ( ) . filter ( |x| * x != Language :: Unknown ) ;
56
50
@@ -60,14 +54,6 @@ fn run() -> Result<()> {
60
54
std:: process:: exit ( 0 ) ;
61
55
}
62
56
63
- let path = String :: from ( matches. value_of ( "input" ) . unwrap ( ) ) ;
64
-
65
- let ascii_language: Language = if let Some ( ascii_language) = matches. value_of ( "ascii-language" )
66
- {
67
- Language :: from_str ( & ascii_language. to_lowercase ( ) ) . unwrap ( )
68
- } else {
69
- Language :: Unknown
70
- } ;
71
57
let mut disabled_fields = InfoFieldOn {
72
58
..Default :: default ( )
73
59
} ;
@@ -101,14 +87,6 @@ fn run() -> Result<()> {
101
87
}
102
88
}
103
89
104
- let ascii_colors: Vec < String > = if let Some ( values) = matches. values_of ( "ascii-colors" ) {
105
- values. map ( String :: from) . collect ( )
106
- } else {
107
- Vec :: new ( )
108
- } ;
109
-
110
- let no_bold = !matches. is_present ( "no-bold" ) ;
111
-
112
90
let image = if let Some ( image_path) = matches. value_of ( "image" ) {
113
91
Some ( image:: open ( image_path) . map_err ( |_| Error :: ImageLoadError ) ?)
114
92
} else {
@@ -136,28 +114,34 @@ fn run() -> Result<()> {
136
114
None
137
115
} ;
138
116
139
- let no_merges = matches. is_present ( "no-merge-commits" ) ;
140
-
141
- let no_color_blocks = matches. is_present ( "no-color-blocks" ) ;
142
-
143
- let number_of_authors: usize = if let Some ( value) = matches. value_of ( "authors-number" ) {
144
- usize:: from_str ( value) . unwrap ( )
145
- } else {
146
- 3
147
- } ;
148
-
149
117
let config = options:: Options {
150
- path,
151
- ascii_language,
152
- ascii_colors,
118
+ path : String :: from ( matches. value_of ( "input" ) . unwrap ( ) ) ,
119
+ ascii_language : if let Some ( ascii_language) = matches. value_of ( "ascii-language" ) {
120
+ Language :: from_str ( & ascii_language. to_lowercase ( ) ) . unwrap ( )
121
+ } else {
122
+ Language :: Unknown
123
+ } ,
124
+ ascii_colors : if let Some ( values) = matches. values_of ( "ascii-colors" ) {
125
+ values. map ( String :: from) . collect ( )
126
+ } else {
127
+ Vec :: new ( )
128
+ } ,
153
129
disabled_fields,
154
- no_bold,
155
- image,
130
+ no_bold : !matches . is_present ( "no-bold" ) ,
131
+ image : image ,
156
132
image_backend,
157
- no_merges,
158
- no_color_blocks,
159
- number_of_authors,
160
- excluded,
133
+ no_merges : matches. is_present ( "no-merge-commits" ) ,
134
+ no_color_blocks : matches. is_present ( "no-color-blocks" ) ,
135
+ number_of_authors : if let Some ( value) = matches. value_of ( "authors-number" ) {
136
+ usize:: from_str ( value) . unwrap ( )
137
+ } else {
138
+ 3
139
+ } ,
140
+ excluded : if let Some ( user_ignored) = matches. values_of ( "exclude" ) {
141
+ user_ignored. map ( String :: from) . collect ( )
142
+ } else {
143
+ Vec :: new ( )
144
+ } ,
161
145
} ;
162
146
163
147
let info = Info :: new ( config) ?;
0 commit comments