-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Deprecate nonsensical StringOps operations #6702
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
Conversation
| * ''n'' times in `that`, then the first ''n'' occurrences of `x` will be retained | ||
| * in the result, but any following occurrences will be omitted. | ||
| */ | ||
| @deprecated("Use `new WrappedString(s).intersect(...).self` instead of `s.diff(...)`", "2.13.0") |
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.
"...instead of s.intersect(...)"
| * @tparam B the type of the elements after being transformed by `f` | ||
| * @return a new string consisting of all the chars of this string without duplicates. | ||
| */ | ||
| @deprecated("Use `new WrappedString(s).distictBy(...).self` instead of `s.distictBy(...)`", "2.13.0") |
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.
distict -> distinct
| * @return An Iterator which traverses the distinct permutations of this string. | ||
| * @example `"abb".permutations = Iterator(abb, bab, bba)` | ||
| */ | ||
| @deprecated("Use `new WrappedString(s).permutations(...).map(_.self)` instead of `s.combinations(...)`", "2.13.0") |
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.
combinations -> permutations
|
@hrhino The kind of bugs that creep in when the workday gets too long :-) |
Maybe some are useful / convenient to keep? In decreasing order of potential usefulness:
|
|
You can still use all of them on a |
lrytz
left a comment
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.
Good point about unicode.
|
the deprecation messages say e.g. but EDIT: better |
|
|
|
PR to revert: #9246 |
Fixes scala/bug#10881
This goes further than just the methods that I identified in #6565 (comment) by deprecating all methods that forward to
WrappedString. I did not implement optimized versions inStringOpsoriginally because these methods do not really make sense forString. Users can always call theWrappedStringequivalents directly (if that's what they really want).