- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.6k
          Add some of [T]’s methods to strings and vice versa
          #1152
        
          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
  
    Add some of [T]’s methods to strings and vice versa
  
  #1152
              Conversation
| Is the reason for adding  | 
| @Kimundi I’ve wanted to use it in the past, but yeah, it’s mainly just to match the  | 
| Is there really a usecase for str::chunks or windows? | 
| Out of curiosity, what is  | 
| @gkoz In principle it's just a runtime-constructed  | 
| @gankro  | 
| Hm, I suspect  | 
        
          
                text/0000-slice-string-symmetry.md
              
                Outdated
          
        
      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.
“Character” is kinda ambiguous. (Unicode has four different definitions.) Maybe use chars instead?
| +1 to functions involving  -1 to  | 
| I just stumbled upon the lack of  | 
| May be out of scope, but I'd like to see some form of  | 
| I concur with @huonw on the dubiousness of windows and chunks in the face of combining characters. It's not clear to me how the Sørensen–Dice coefficient is even supposed to interact with utf8 in that regard. 👍 on the Box conversions. Makes sense. I'm completely indifferent on subslice_offset | 
| This RFC is now entering its final comment period. | 
        
          
                text/0000-slice-string-symmetry.md
              
                Outdated
          
        
      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.
I would personally prefer to not add this method to slices just yet, I suspect it won't survive stabilization of strings.
| I also agree with @huonw about being hesitant to add windows/chunks to strings due to unicode fun stuff. | 
        
          
                text/0000-slice-string-symmetry.md
              
                Outdated
          
        
      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.
| The  | 
| @P1start the libs team seems pretty unanimous about  | 
| @gankro Yep, that’s fine by me. I’ll update the RFC soon to include just those methods (and rename  | 
| RFC updated, removing  | 
| The consensus of the libs team is to merge this RFC, so I will do so. Thanks again @P1start! | 
This is the name that was decided in rust-lang/rfcs#1152, and it's better if we say “boxed str” for `Box<str>`. The old name `String::into_boxed_slice` is deprecated.
Rename String::into_boxed_slice -> into_boxed_str This is the name that was decided in rust-lang/rfcs#1152, and it's better if we say “boxed str” for `Box<str>`. The old name `String::into_boxed_slice` is deprecated.
Rename String::into_boxed_slice -> into_boxed_str This is the name that was decided in rust-lang/rfcs#1152, and it's better if we say “boxed str” for `Box<str>`. The old name `String::into_boxed_slice` is deprecated.
Add some methods that already exist on slices to strings and vice versa. Specifically, the following methods should be added:
str::chunksstr::windowsstr::into_stringString::into_boxed_slice<[T]>::subslice_offsetRendered