We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56cf237 commit 713ca7dCopy full SHA for 713ca7d
src/libstd/char.rs
@@ -69,6 +69,7 @@ static TAG_FOUR_B: uint = 240u;
69
pub static MAX: char = '\U0010ffff';
70
71
/// Convert from `u32` to a character.
72
+#[inline]
73
pub fn from_u32(i: u32) -> Option<char> {
74
// catch out-of-bounds and surrogates
75
if (i > MAX as u32) || (i >= 0xD800 && i <= 0xDFFF) {
src/libstd/str.rs
@@ -1061,6 +1061,7 @@ static UTF8_CHAR_WIDTH: [u8, ..256] = [
1061
];
1062
1063
/// Given a first byte, determine how many bytes are in this UTF-8 character
1064
1065
pub fn utf8_char_width(b: u8) -> uint {
1066
return UTF8_CHAR_WIDTH[b] as uint;
1067
}
0 commit comments