mgeisler / textwrap

An efficient and powerful Rust library for word wrapping text.
MIT License
446 stars 44 forks source link

Add `Options::width` #521

Closed 9999years closed 10 months ago

9999years commented 11 months ago

This is a convenience method to set the width of the Options struct. I found it useful to have builder-style access to this property, and it matches some of the other provided methods.

mgeisler commented 10 months ago

Hi @9999years, thanks for improving the crate!

Over the years, I've been torn between going all in on the builder pattern and letting people configure the options using public fields — and as a result, we now have both :smile: However, I now lean more towards using a builder pattern throughout. Would you be up for making a PR which hides the fields and turns this into a "proper" builder?