-
Notifications
You must be signed in to change notification settings - Fork 13.4k
More str cleanup #7123
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
More str cleanup #7123
Conversation
@huonw |
@Kimundi I see. Moving it to |
The first two become map_chars and lev_distance. Also, remove a few allocations in rustdoc.
This moves them all into the traits submodule, and delegates Ord to the TotalOrd instance. It also deletes the stand-alone lt, gt, ge and le functions.
@@ -22,6 +22,7 @@ use markdown_writer::WriterFactory; | |||
use pass::Pass; | |||
use sort_pass; | |||
|
|||
use core::iterator::IteratorUtil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IteratorUtil is in prelude now, so this could be removed
Moves all the remaining functions that could reasonably be methods to be methods, except for some FFI ones (which I believe @erickt is working on, possibly) and `each_split_within`, since I'm not really sure the details of it (I believe @Kimundi wrote the current implementation, so maybe he could convert it to an external iterator method on `StrSlice`, e.g. `word_wrap_iter(&self) -> WordWrapIterator<'self>`, where `WordWrapIterator` impls `Iterator<&'self str>`. It probably won't be too hard, since it's already a state machine.) This also cleans up the comparison impls for the string types, except I'm not sure how the lang items `eq_str` and `eq_str_uniq` need to be handled, so they (`eq_slice` and `eq`) remain stand-alone functions.
Moves all the remaining functions that could reasonably be methods to be methods, except for some FFI ones (which I believe @erickt is working on, possibly) and
each_split_within
, since I'm not really sure the details of it (I believe @Kimundi wrote the current implementation, so maybe he could convert it to an external iterator method onStrSlice
, e.g.word_wrap_iter(&self) -> WordWrapIterator<'self>
, whereWordWrapIterator
implsIterator<&'self str>
. It probably won't be too hard, since it's already a state machine.)This also cleans up the comparison impls for the string types, except I'm not sure how the lang items
eq_str
andeq_str_uniq
need to be handled, so they (eq_slice
andeq
) remain stand-alone functions.