Skip to content

Commit 8777841

Browse files
committed
---
yaml --- r: 160504 b: refs/heads/auto c: acb5fef h: refs/heads/master v: v3
1 parent c86924e commit 8777841

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: c2aff692fa88235d356725f98184a5ea5b52eb88
13+
refs/heads/auto: acb5fefd6d9933b345873355c2c0100184c74727
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libcore/char.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,24 @@ pub trait Char {
245245
/// # Panics
246246
///
247247
/// Panics if given a radix > 36.
248+
#[deprecated = "use is_digit"]
248249
fn is_digit_radix(&self, radix: uint) -> bool;
249250

251+
/// Checks if a `char` parses as a numeric digit in the given radix.
252+
///
253+
/// Compared to `is_digit()`, this function only recognizes the characters
254+
/// `0-9`, `a-z` and `A-Z`.
255+
///
256+
/// # Return value
257+
///
258+
/// Returns `true` if `c` is a valid digit under `radix`, and `false`
259+
/// otherwise.
260+
///
261+
/// # Failure
262+
///
263+
/// Fails if given a radix > 36.
264+
fn is_digit(&self, radix: uint) -> bool;
265+
250266
/// Converts a character to the corresponding digit.
251267
///
252268
/// # Return value
@@ -319,8 +335,11 @@ pub trait Char {
319335

320336
#[experimental = "trait is experimental"]
321337
impl Char for char {
338+
#[deprecated = "use is_digit"]
322339
fn is_digit_radix(&self, radix: uint) -> bool { is_digit_radix(*self, radix) }
323340

341+
fn is_digit(&self, radix: uint) -> bool { is_digit_radix(*self, radix) }
342+
324343
fn to_digit(&self, radix: uint) -> Option<uint> { to_digit(*self, radix) }
325344

326345
fn from_digit(num: uint, radix: uint) -> Option<char> { from_digit(num, radix) }

0 commit comments

Comments
 (0)