@@ -80,7 +80,7 @@ static TAG_FOUR_B: uint = 240u;
8080/// The highest valid code point
8181pub static MAX : char = ' \U 0010 ffff' ;
8282
83- /// Convert from `u32` to a `char`.
83+ /// Converts from `u32` to a `char`
8484#[ inline]
8585pub fn from_u32 ( i : u32 ) -> Option < char > {
8686 // catch out-of-bounds and surrogates
@@ -91,31 +91,34 @@ pub fn from_u32(i: u32) -> Option<char> {
9191 }
9292}
9393
94- /// Returns whether the specified `char` is considered a unicode alphabetic
95- /// scalar value
94+ /// Returns whether the specified `char` is considered a Unicode alphabetic
95+ /// code point
9696pub fn is_alphabetic ( c : char ) -> bool { derived_property:: Alphabetic ( c) }
9797#[ allow( missing_doc) ]
9898pub fn is_XID_start ( c : char ) -> bool { derived_property:: XID_Start ( c) }
9999#[ allow( missing_doc) ]
100100pub fn is_XID_continue ( c : char ) -> bool { derived_property:: XID_Continue ( c) }
101101
102102///
103- /// Indicates whether a `char` is in lower case, defined
104- /// in terms of the Unicode Derived Core Property 'Lowercase'.
103+ /// Indicates whether a `char` is in lower case
104+ ///
105+ /// This is defined according to the terms of the Unicode Derived Core Property 'Lowercase'.
105106///
106107#[ inline]
107108pub fn is_lowercase ( c : char ) -> bool { derived_property:: Lowercase ( c) }
108109
109110///
110- /// Indicates whether a `char` is in upper case, defined
111- /// in terms of the Unicode Derived Core Property 'Uppercase'.
111+ /// Indicates whether a `char` is in upper case
112+ ///
113+ /// This is defined according to the terms of the Unicode Derived Core Property 'Uppercase'.
112114///
113115#[ inline]
114116pub fn is_uppercase ( c : char ) -> bool { derived_property:: Uppercase ( c) }
115117
116118///
117- /// Indicates whether a `char` is whitespace. Whitespace is defined in
118- /// terms of the Unicode Property 'White_Space'.
119+ /// Indicates whether a `char` is whitespace
120+ ///
121+ /// Whitespace is defined in terms of the Unicode Property 'White_Space'.
119122///
120123#[ inline]
121124pub fn is_whitespace ( c : char ) -> bool {
@@ -126,9 +129,10 @@ pub fn is_whitespace(c: char) -> bool {
126129}
127130
128131///
129- /// Indicates whether a `char` is alphanumeric. Alphanumericness is
130- /// defined in terms of the Unicode General Categories 'Nd', 'Nl', 'No'
131- /// and the Derived Core Property 'Alphabetic'.
132+ /// Indicates whether a `char` is alphanumeric
133+ ///
134+ /// Alphanumericness is defined in terms of the Unicode General Categories
135+ /// 'Nd', 'Nl', 'No' and the Derived Core Property 'Alphabetic'.
132136///
133137#[ inline]
134138pub fn is_alphanumeric ( c : char ) -> bool {
@@ -139,8 +143,9 @@ pub fn is_alphanumeric(c: char) -> bool {
139143}
140144
141145///
142- /// Indicates whether a `char` is a control code point. Control
143- /// code points are defined in terms of the Unicode General Category
146+ /// Indicates whether a `char` is a control code point
147+ ///
148+ /// Control code points are defined in terms of the Unicode General Category
144149/// 'Cc'.
145150///
146151#[ inline]
@@ -155,7 +160,8 @@ pub fn is_digit(c: char) -> bool {
155160}
156161
157162///
158- /// Checks if a `char` parses as a numeric digit in the given radix.
163+ /// Checks if a `char` parses as a numeric digit in the given radix
164+ ///
159165/// Compared to `is_digit()`, this function only recognizes the
160166/// characters `0-9`, `a-z` and `A-Z`.
161167///
@@ -181,7 +187,7 @@ pub fn is_digit_radix(c: char, radix: uint) -> bool {
181187}
182188
183189///
184- /// Convert a `char` to the corresponding digit.
190+ /// Converts a `char` to the corresponding digit
185191///
186192/// # Return value
187193///
@@ -210,7 +216,7 @@ pub fn to_digit(c: char, radix: uint) -> Option<uint> {
210216}
211217
212218///
213- /// Converts a number to the character representing it.
219+ /// Converts a number to the character representing it
214220///
215221/// # Return value
216222///
@@ -268,7 +274,7 @@ fn decompose_hangul(s: char, f: |char|) {
268274 }
269275}
270276
271- /// Returns the canonical decomposition of a character.
277+ /// Returns the canonical decomposition of a character
272278pub fn decompose_canonical ( c : char , f: |char|) {
273279 if ( c as uint ) < S_BASE || ( c as uint ) >= ( S_BASE + S_COUNT ) {
274280 decompose:: canonical ( c, f) ;
@@ -277,7 +283,7 @@ pub fn decompose_canonical(c: char, f: |char|) {
277283 }
278284}
279285
280- /// Returns the compatibility decomposition of a character.
286+ /// Returns the compatibility decomposition of a character
281287pub fn decompose_compatible ( c : char , f: |char|) {
282288 if ( c as uint ) < S_BASE || ( c as uint ) >= ( S_BASE + S_COUNT ) {
283289 decompose:: compatibility ( c, f) ;
@@ -287,7 +293,7 @@ pub fn decompose_compatible(c: char, f: |char|) {
287293}
288294
289295///
290- /// Return the hexadecimal unicode escape of a `char`.
296+ /// Returns the hexadecimal Unicode escape of a `char`
291297///
292298/// The rules are as follows:
293299///
@@ -315,7 +321,7 @@ pub fn escape_unicode(c: char, f: |char|) {
315321}
316322
317323///
318- /// Return a 'default' ASCII and C++11-like literal escape of a `char`.
324+ /// Returns a 'default' ASCII and C++11-like literal escape of a `char`
319325///
320326/// The default is chosen with a bias toward producing literals that are
321327/// legal in a variety of languages, including C++11 and similar C-family
@@ -374,8 +380,9 @@ pub trait Char {
374380 fn escape_default ( & self , f: |char|) ;
375381 fn len_utf8_bytes ( & self ) -> uint ;
376382
377- /// Encodes this `char` as utf-8 into the provided byte-buffer. The
378- /// buffer must be at least 4 bytes long or a runtime failure will occur.
383+ /// Encodes this `char` as utf-8 into the provided byte-buffer
384+ ///
385+ /// The buffer must be at least 4 bytes long or a runtime failure will occur.
379386 ///
380387 /// This will then return the number of characters written to the slice.
381388 fn encode_utf8 ( & self , dst : & mut [ u8 ] ) -> uint ;
0 commit comments