You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Potential very minor improvement in styling: accepting || {Doc} closures
#400
I was trying to replicate the with_usage example of having formatted text in other fields like short/long, but couldn't, the copy&pasted || {} style didn't work.
I had to recreate Doc in a separate variable and pass it to the options before the obvious solution dawned on me that I could just use {} in-place as well
So just an idea: maybe still the signature of long/short could also accept closures generating Doc?
.header("Sometimes they even work.").footer("Beware `-d`, dragons be here").with_usage(|doc| {letmut u = Doc::default();
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I was trying to replicate the
with_usageexample of having formatted text in other fields likeshort/long, but couldn't, the copy&pasted|| {}style didn't work.I had to recreate
Docin a separate variable and pass it to the options before the obvious solution dawned on me that I could just use{}in-place as wellSo just an idea: maybe still the signature of long/short could also accept closures generating
Doc?All reactions