Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Wrapper.splitter from T: WordSplitter to Box<dyn WordSplitter> #206

Merged
merged 1 commit into from
Sep 15, 2020

Commits on Sep 15, 2020

  1. Change Wrapper.splitter from T: WordSplitter to Box<dyn WordSplitter>

    Before, the Wrapper would be generic in the type of WordSplitter used.
    This meant that Wrapper<NoHyphenation> would be a different type than
    Wrapper<HyphenSplitter>.
    
    The result is that you need to fix the type of WordSplitter at compile
    time. This makes it hard to make interactive programs, something which
    was raised in #178.
    
    Making splitter a Box<dyn WordSplitter> makes the field less special.
    We can therefore simplify the API by removing the with_splitter
    constructor.
    
    The performance is unchanged by this, even when testing with the
    hyphenation feature enabled.
    mgeisler committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    6810a97 View commit details
    Browse the repository at this point in the history