Skip to content

Commit 58df10b

Browse files
committed
---
yaml --- r: 161146 b: refs/heads/snap-stage3 c: acb5fef h: refs/heads/master v: v3
1 parent f3746e2 commit 58df10b

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: c2aff692fa88235d356725f98184a5ea5b52eb88
4+
refs/heads/snap-stage3: acb5fefd6d9933b345873355c2c0100184c74727
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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)