-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to static dispatch by default.
This commit essentially changes the return type of `Options::new` from `Options<Box<dyn WordSplitter>>` to `Options<HyphenSplitter>`, also making it a `const fn` in the process. Also the `Options::splitter` method is changed in order to allow returning a `Options` with a different type parameter, which is sort of necessary for static dispatch. However, this also allows to change to dynamic dispatch. This also make the `Options::new(w).splitter(s)` combination consistently equivalent to `Options::with_splitter(w, s)`, tho only the latter is a `const fn`. Also test cases have been adapted to favor static dispatch.
- Loading branch information
Showing
8 changed files
with
144 additions
and
58 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
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
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
Oops, something went wrong.