Skip to content

Commit d08952c

Browse files
committed
Merge remote-tracking branch 'huonw/inline-helpers'
2 parents eb33955 + 713ca7d commit d08952c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/libstd/char.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static TAG_FOUR_B: uint = 240u;
6969
pub static MAX: char = '\U0010ffff';
7070

7171
/// Convert from `u32` to a character.
72+
#[inline]
7273
pub fn from_u32(i: u32) -> Option<char> {
7374
// catch out-of-bounds and surrogates
7475
if (i > MAX as u32) || (i >= 0xD800 && i <= 0xDFFF) {

src/libstd/str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ static UTF8_CHAR_WIDTH: [u8, ..256] = [
10611061
];
10621062

10631063
/// Given a first byte, determine how many bytes are in this UTF-8 character
1064+
#[inline]
10641065
pub fn utf8_char_width(b: u8) -> uint {
10651066
return UTF8_CHAR_WIDTH[b] as uint;
10661067
}

0 commit comments

Comments
 (0)