diff options
| author | Jon Morton <jonanin@gmail.com> | 2012-04-06 01:12:49 -0500 |
|---|---|---|
| committer | Jon Morton <jonanin@gmail.com> | 2012-04-06 01:12:49 -0500 |
| commit | d621ada003cd3464d52fb65f95f6767e62befa6f (patch) | |
| tree | cede556cd6300b4022d4f57b1ac43770fe0643af | |
| parent | 851fde879d85f3b76b42322f46cdc00c5f97e357 (diff) | |
| download | rust-d621ada003cd3464d52fb65f95f6767e62befa6f.tar.gz rust-d621ada003cd3464d52fb65f95f6767e62befa6f.zip | |
Add len to str extensions
| -rw-r--r-- | src/libcore/str.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 421eb587862..dc7baa04efd 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -1783,6 +1783,9 @@ impl extensions for str { "] #[inline] fn is_whitespace() -> bool { is_whitespace(self) } + #[inline] + #[doc ="Returns the size in bytes not counting the null terminator"] + fn len() -> uint { len(self) } #[doc = " Returns a slice of the given string from the byte range [`begin`..`end`) |
