about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-10-18 15:38:32 +0200
committerMara Bos <m-ou.se@m-ou.se>2020-10-18 15:38:32 +0200
commit7a25123845778fdaa715815cc9ec917a67c35dbd (patch)
tree6f8df8eeeefb4cab933d829dc89c70d7096c5442
parentad268bd63894953ab7038f082aa744d6a832639b (diff)
downloadrust-7a25123845778fdaa715815cc9ec917a67c35dbd.tar.gz
rust-7a25123845778fdaa715815cc9ec917a67c35dbd.zip
Add #[inline] to the Utf8Error accessors.
-rw-r--r--library/core/src/str/error.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/str/error.rs b/library/core/src/str/error.rs
index 427f720d68c..ccf7b20285c 100644
--- a/library/core/src/str/error.rs
+++ b/library/core/src/str/error.rs
@@ -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)
     }