forked from mgeisler/textwrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reintroducing the type parameter on
Options
(previously Wrapper
).
This commit reverts the internal changes of mgeisler#206, but keeps the public API compatible to what it introduced. Essetially by adding a default for the type parameter. However, now in addition to the dynamic dispatch by default, one may also explicitly use static dispatch by specifying the type parameter. This now allows to construct an `Options` instance in const/static context. Which is further facilitated by adding the const fn `with_splitter`. Also, since `Options` now may be some specific type the `Clone` derive is added again. So when `S` is `Clone` then `Options` is `Clone` too. This change is actually backwards compatible with the previous commit, as seen by the unchanged examples and tests.
- Loading branch information
Showing
2 changed files
with
177 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters