@@ -166,7 +166,7 @@ pub fn width(c: char, is_cjk: bool) -> Option<uint> {
166
166
pub trait UnicodeChar {
167
167
/// Returns whether the specified character is considered a Unicode
168
168
/// alphabetic code point.
169
- fn is_alphabetic ( & self ) -> bool ;
169
+ fn is_alphabetic ( self ) -> bool ;
170
170
171
171
/// Returns whether the specified character satisfies the 'XID_Start'
172
172
/// Unicode property.
@@ -175,7 +175,7 @@ pub trait UnicodeChar {
175
175
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
176
176
/// mostly similar to ID_Start but modified for closure under NFKx.
177
177
#[ allow( non_snake_case) ]
178
- fn is_XID_start ( & self ) -> bool ;
178
+ fn is_XID_start ( self ) -> bool ;
179
179
180
180
/// Returns whether the specified `char` satisfies the 'XID_Continue'
181
181
/// Unicode property.
@@ -184,40 +184,40 @@ pub trait UnicodeChar {
184
184
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
185
185
/// mostly similar to 'ID_Continue' but modified for closure under NFKx.
186
186
#[ allow( non_snake_case) ]
187
- fn is_XID_continue ( & self ) -> bool ;
187
+ fn is_XID_continue ( self ) -> bool ;
188
188
189
189
190
190
/// Indicates whether a character is in lowercase.
191
191
///
192
192
/// This is defined according to the terms of the Unicode Derived Core
193
193
/// Property `Lowercase`.
194
- fn is_lowercase ( & self ) -> bool ;
194
+ fn is_lowercase ( self ) -> bool ;
195
195
196
196
/// Indicates whether a character is in uppercase.
197
197
///
198
198
/// This is defined according to the terms of the Unicode Derived Core
199
199
/// Property `Uppercase`.
200
- fn is_uppercase ( & self ) -> bool ;
200
+ fn is_uppercase ( self ) -> bool ;
201
201
202
202
/// Indicates whether a character is whitespace.
203
203
///
204
204
/// Whitespace is defined in terms of the Unicode Property `White_Space`.
205
- fn is_whitespace ( & self ) -> bool ;
205
+ fn is_whitespace ( self ) -> bool ;
206
206
207
207
/// Indicates whether a character is alphanumeric.
208
208
///
209
209
/// Alphanumericness is defined in terms of the Unicode General Categories
210
210
/// 'Nd', 'Nl', 'No' and the Derived Core Property 'Alphabetic'.
211
- fn is_alphanumeric ( & self ) -> bool ;
211
+ fn is_alphanumeric ( self ) -> bool ;
212
212
213
213
/// Indicates whether a character is a control code point.
214
214
///
215
215
/// Control code points are defined in terms of the Unicode General
216
216
/// Category `Cc`.
217
- fn is_control ( & self ) -> bool ;
217
+ fn is_control ( self ) -> bool ;
218
218
219
219
/// Indicates whether the character is numeric (Nd, Nl, or No).
220
- fn is_numeric ( & self ) -> bool ;
220
+ fn is_numeric ( self ) -> bool ;
221
221
222
222
/// Converts a character to its lowercase equivalent.
223
223
///
@@ -228,7 +228,7 @@ pub trait UnicodeChar {
228
228
///
229
229
/// Returns the lowercase equivalent of the character, or the character
230
230
/// itself if no conversion is possible.
231
- fn to_lowercase ( & self ) -> char ;
231
+ fn to_lowercase ( self ) -> char ;
232
232
233
233
/// Converts a character to its uppercase equivalent.
234
234
///
@@ -250,7 +250,7 @@ pub trait UnicodeChar {
250
250
/// [`SpecialCasing`.txt`]: ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt
251
251
///
252
252
/// [2]: http://www.unicode.org/versions/Unicode4.0.0/ch03.pdf#G33992
253
- fn to_uppercase ( & self ) -> char ;
253
+ fn to_uppercase ( self ) -> char ;
254
254
255
255
/// Returns this character's displayed width in columns, or `None` if it is a
256
256
/// control character other than `'\x00'`.
@@ -261,31 +261,33 @@ pub trait UnicodeChar {
261
261
/// [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/)
262
262
/// recommends that these characters be treated as 1 column (i.e.,
263
263
/// `is_cjk` = `false`) if the context cannot be reliably determined.
264
- fn width ( & self , is_cjk : bool ) -> Option < uint > ;
264
+ #[ experimental = "needs expert opinion. is_cjk flag stands out as ugly" ]
265
+ fn width ( self , is_cjk : bool ) -> Option < uint > ;
265
266
}
266
267
267
268
impl UnicodeChar for char {
268
- fn is_alphabetic ( & self ) -> bool { is_alphabetic ( * self ) }
269
+ fn is_alphabetic ( self ) -> bool { is_alphabetic ( self ) }
269
270
270
- fn is_XID_start ( & self ) -> bool { is_XID_start ( * self ) }
271
+ fn is_XID_start ( self ) -> bool { is_XID_start ( self ) }
271
272
272
- fn is_XID_continue ( & self ) -> bool { is_XID_continue ( * self ) }
273
+ fn is_XID_continue ( self ) -> bool { is_XID_continue ( self ) }
273
274
274
- fn is_lowercase ( & self ) -> bool { is_lowercase ( * self ) }
275
+ fn is_lowercase ( self ) -> bool { is_lowercase ( self ) }
275
276
276
- fn is_uppercase ( & self ) -> bool { is_uppercase ( * self ) }
277
+ fn is_uppercase ( self ) -> bool { is_uppercase ( self ) }
277
278
278
- fn is_whitespace ( & self ) -> bool { is_whitespace ( * self ) }
279
+ fn is_whitespace ( self ) -> bool { is_whitespace ( self ) }
279
280
280
- fn is_alphanumeric ( & self ) -> bool { is_alphanumeric ( * self ) }
281
+ fn is_alphanumeric ( self ) -> bool { is_alphanumeric ( self ) }
281
282
282
- fn is_control ( & self ) -> bool { is_control ( * self ) }
283
+ fn is_control ( self ) -> bool { is_control ( self ) }
283
284
284
- fn is_numeric ( & self ) -> bool { is_digit ( * self ) }
285
+ fn is_numeric ( self ) -> bool { is_digit ( self ) }
285
286
286
- fn to_lowercase ( & self ) -> char { to_lowercase ( * self ) }
287
+ fn to_lowercase ( self ) -> char { to_lowercase ( self ) }
287
288
288
- fn to_uppercase ( & self ) -> char { to_uppercase ( * self ) }
289
+ fn to_uppercase ( self ) -> char { to_uppercase ( self ) }
289
290
290
- fn width ( & self , is_cjk : bool ) -> Option < uint > { width ( * self , is_cjk) }
291
+ #[ experimental = "needs expert opinion. is_cjk flag stands out as ugly" ]
292
+ fn width ( self , is_cjk : bool ) -> Option < uint > { width ( self , is_cjk) }
291
293
}
0 commit comments