mgeisler / textwrap

An efficient and powerful Rust library for word wrapping text.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduce a trait for `WrapAlgorithm`

mgeisler opened this issue · comments

The WrapAlgorithm enum should be turned into a trait. This will allow us to

  1. Avoid doing .collect::<Vec<_>>() in our procesing pipeline. We do this today since the different wrapping algorithms return different Iterator types.
  2. Make the wrapping algorithm extensible by clients of the library.