Skip to content

Commit ce8023b

Browse files
committed
Merge pull request #2139 from Jonanin/add_str_len
Add len to str extensions
2 parents 051f24d + d621ada commit ce8023b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libcore/str.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,9 @@ impl extensions for str {
17831783
"]
17841784
#[inline]
17851785
fn is_whitespace() -> bool { is_whitespace(self) }
1786+
#[inline]
1787+
#[doc ="Returns the size in bytes not counting the null terminator"]
1788+
fn len() -> uint { len(self) }
17861789
#[doc = "
17871790
Returns a slice of the given string from the byte range [`begin`..`end`)
17881791

0 commit comments

Comments
 (0)