rust/src/libcore/num
Jakub Bukaj db4d60afb0 rollup merge of #18911: canndrew/slice_shift_char
`slice_shift_char` splits a `str` into it's leading `char` and the remainder of the `str`. Currently, it returns a `(Option<char>, &str)` such that:

    "bar".slice_shift_char() => (Some('b'), "ar")
    "ar".slice_shift_char()  => (Some('a'), "r")
    "r".slice_shift_char()   => (Some('r'), "")
    "".slice_shift_char()    => (None,      "")

This is a little odd. Either a `str` can be split into both a head and a tail or it cannot. So the return type should be `Option<(char, &str)>`. With the current behaviour, in the case of the empty string, the `str` returned is meaningless - it is always the empty string.

This PR changes `slice_shift_char` so that:

    "bar".slice_shift_char() => Some(('b', "ar"))
    "ar".slice_shift_char()  => Some(('a', "r"))
    "r".slice_shift_char()   => Some(('r', ""))
    "".slice_shift_char()    => None
2014-11-18 00:23:55 +01:00
..
f32.rs Remove core::num::strconv 2014-11-16 12:41:55 +11:00
f64.rs Remove core::num::strconv 2014-11-16 12:41:55 +11:00
float_macros.rs Remove Signed trait and add SignedInt trait 2014-11-13 03:46:03 +11:00
i8.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00
i16.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00
i32.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00
i64.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00
int_macros.rs Remove core::num::strconv 2014-11-16 12:41:55 +11:00
int.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00
mod.rs rollup merge of #18911: canndrew/slice_shift_char 2014-11-18 00:23:55 +01:00
u8.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00
u16.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00
u32.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00
u64.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00
uint_macros.rs Remove core::num::strconv 2014-11-16 12:41:55 +11:00
uint.rs std: Add stability attributes to primitive numeric modules 2014-06-24 17:23:05 -07:00