While writing https://github.com/Cldfire/password-rules-checker I came across a place where it would be nice to have a way to pretty-print a CharacterClass:
let possibly_shortened_allows = remove_unecessary_allows(&quirk_parsed);
if quirk_parsed.allowed != possibly_shortened_allows {
// TODO: pretty print the suggestion
println!(
"{}: the `allowed` property for this rule can be shortened to: {:?}",
site, possibly_shortened_allows
);
}
I'd like to print allowed: upper, [%^*]; instead of [Upper, Custom(['%', '^', '*'])]. A Display impl for CharacterClass would make that simple.
While writing https://github.com/Cldfire/password-rules-checker I came across a place where it would be nice to have a way to pretty-print a
CharacterClass:I'd like to print
allowed: upper, [%^*];instead of[Upper, Custom(['%', '^', '*'])]. ADisplayimpl forCharacterClasswould make that simple.