Skip to content

Commit 7a25123

Browse files
committed
Add #[inline] to the Utf8Error accessors.
1 parent ad268bd commit 7a25123

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/str/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ impl Utf8Error {
7272
/// assert_eq!(1, error.valid_up_to());
7373
/// ```
7474
#[stable(feature = "utf8_error", since = "1.5.0")]
75+
#[inline]
7576
pub fn valid_up_to(&self) -> usize {
7677
self.valid_up_to
7778
}
@@ -92,6 +93,7 @@ impl Utf8Error {
9293
///
9394
/// [U+FFFD]: ../../std/char/constant.REPLACEMENT_CHARACTER.html
9495
#[stable(feature = "utf8_error_error_len", since = "1.20.0")]
96+
#[inline]
9597
pub fn error_len(&self) -> Option<usize> {
9698
self.error_len.map(|len| len as usize)
9799
}

0 commit comments

Comments
 (0)