Add #[inline] to the Utf8Error accessors.
This commit is contained in:
parent
ad268bd638
commit
7a25123845
1 changed files with 2 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue