core: Add each, each_char to str::extensions
This commit is contained in:
parent
8641c95221
commit
6e8cf935db
1 changed files with 6 additions and 0 deletions
|
@ -1761,6 +1761,12 @@ impl extensions for str {
|
||||||
#[doc = "Returns true if one string contains another"]
|
#[doc = "Returns true if one string contains another"]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn contains(needle: str) -> bool { contains(self, needle) }
|
fn contains(needle: str) -> bool { contains(self, needle) }
|
||||||
|
#[doc = "Iterate over the bytes in a string"]
|
||||||
|
#[inline]
|
||||||
|
fn each(it: fn(u8) -> bool) { each(self, it) }
|
||||||
|
#[doc = "Iterate over the chars in a string"]
|
||||||
|
#[inline]
|
||||||
|
fn each_char(it: fn(char) -> bool) { each_char(self, it) }
|
||||||
#[doc = "Returns true if one string ends with another"]
|
#[doc = "Returns true if one string ends with another"]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn ends_with(needle: str) -> bool { ends_with(self, needle) }
|
fn ends_with(needle: str) -> bool { ends_with(self, needle) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue