@@ -169,33 +169,36 @@ impl Cfg {
169
169
msg
170
170
}
171
171
172
- /// Renders the configuration for long display, as a long HTML description.
173
- pub ( crate ) fn render_long_html ( & self ) -> String {
172
+ fn render_long_inner ( & self , format : Format ) -> String {
174
173
let on = if self . omit_preposition ( ) {
175
- ""
174
+ " "
176
175
} else if self . should_use_with_in_description ( ) {
177
- "with "
176
+ " with "
178
177
} else {
179
- "on "
178
+ " on "
180
179
} ;
181
180
182
- let mut msg = format ! ( "Available {on}<strong>{}</strong>" , Display ( self , Format :: LongHtml ) ) ;
181
+ let mut msg = if matches ! ( format, Format :: LongHtml ) {
182
+ format ! ( "Available{on}<strong>{}</strong>" , Display ( self , format) )
183
+ } else {
184
+ format ! ( "Available{on}{}" , Display ( self , format) )
185
+ } ;
183
186
if self . should_append_only_to_description ( ) {
184
187
msg. push_str ( " only" ) ;
185
188
}
189
+ msg
190
+ }
191
+
192
+ /// Renders the configuration for long display, as a long HTML description.
193
+ pub ( crate ) fn render_long_html ( & self ) -> String {
194
+ let mut msg = self . render_long_inner ( Format :: LongHtml ) ;
186
195
msg. push ( '.' ) ;
187
196
msg
188
197
}
189
198
190
199
/// Renders the configuration for long display, as a long plain text description.
191
200
pub ( crate ) fn render_long_plain ( & self ) -> String {
192
- let on = if self . should_use_with_in_description ( ) { "with" } else { "on" } ;
193
-
194
- let mut msg = format ! ( "Available {on} {}" , Display ( self , Format :: LongPlain ) ) ;
195
- if self . should_append_only_to_description ( ) {
196
- msg. push_str ( " only" ) ;
197
- }
198
- msg
201
+ self . render_long_inner ( Format :: LongPlain )
199
202
}
200
203
201
204
fn should_capitalize_first_letter ( & self ) -> bool {
0 commit comments