Add #[inline] to the Utf8Error accessors.

This commit is contained in:
Mara Bos 2020-10-18 15:38:32 +02:00
parent ad268bd638
commit 7a25123845

View File

@ -72,6 +72,7 @@ impl Utf8Error {
/// assert_eq!(1, error.valid_up_to());
/// ```
#[stable(feature = "utf8_error", since = "1.5.0")]
#[inline]
pub fn valid_up_to(&self) -> usize {
self.valid_up_to
}
@ -92,6 +93,7 @@ impl Utf8Error {
///
/// [U+FFFD]: ../../std/char/constant.REPLACEMENT_CHARACTER.html
#[stable(feature = "utf8_error_error_len", since = "1.20.0")]
#[inline]
pub fn error_len(&self) -> Option<usize> {
self.error_len.map(|len| len as usize)
}