implement rfc 1054: split_whitespace() fn, deprecate words()
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to s.words() throughout codebase. Closes #15628
This commit is contained in:
parent
f43c86cda4
commit
c361e13d71
11 changed files with 53 additions and 28 deletions
|
|
@ -9,11 +9,9 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(str_words)]
|
||||
|
||||
fn main() {
|
||||
let foo = "hello".to_string();
|
||||
let foo: Vec<&str> = foo.words().collect();
|
||||
let foo: Vec<&str> = foo.split_whitespace().collect();
|
||||
let invalid_string = &foo[0];
|
||||
assert_eq!(*invalid_string, "hello");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue