rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Replace wrap_str with validate_shape

Open camsteffen opened this issue 1 year ago • 2 comments

This ultimately re-uses Shape::exceeds_max_width_error more to be a tad DRYer.

camsteffen avatar Dec 03 '24 00:12 camsteffen

Would it be simpler to have wrap_str return Result<String, ExceedsMaxWidthError>?

ytmimi avatar Dec 03 '24 17:12 ytmimi

I like how borrowing makes it clear that the string isn't modified personally. But that would be a more conservative change.

camsteffen avatar Dec 07 '24 19:12 camsteffen