File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -189,14 +189,16 @@ impl Cfg {
189189 }
190190
191191 /// Renders the configuration for long display, as a long plain text description.
192- pub ( crate ) fn render_long_plain ( & self ) -> String {
192+ pub ( crate ) fn render_long_plain ( & self ) -> impl fmt :: Display + ' _ {
193193 let on = if self . should_use_with_in_description ( ) { "with" } else { "on" } ;
194194
195- let mut msg = format ! ( "Available {on} {}" , Display ( self , Format :: LongPlain ) ) ;
196- if self . should_append_only_to_description ( ) {
197- msg. push_str ( " only" ) ;
198- }
199- msg
195+ fmt:: from_fn ( move |f| {
196+ write ! ( f, "Available {on} {}" , Display ( self , Format :: LongPlain ) ) ?;
197+ if self . should_append_only_to_description ( ) {
198+ f. write_str ( " only" ) ?;
199+ }
200+ Ok ( ( ) )
201+ } )
200202 }
201203
202204 fn should_capitalize_first_letter ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments