core: Add each, each_char to str::extensions
This commit is contained in:
@@ -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) }
|
||||||
|
|||||||
Reference in New Issue
Block a user