From d621ada003cd3464d52fb65f95f6767e62befa6f Mon Sep 17 00:00:00 2001 From: Jon Morton Date: Fri, 6 Apr 2012 01:12:49 -0500 Subject: [PATCH] Add len to str extensions --- src/libcore/str.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 421eb5878620..dc7baa04efd4 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`)