]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/slice/iter.rs
Rollup merge of #103051 - davidtwco:translation-tidying-up, r=compiler-errors
[rust.git] / library / core / src / slice / iter.rs
index ad39ce38319dd38c2f64ab01eef53b4dde33cad1..8a8962828e9801d0209082f466301217446530e0 100644 (file)
@@ -124,6 +124,7 @@ pub(super) fn new(slice: &'a [T]) -> Self {
     /// ```
     #[must_use]
     #[stable(feature = "iter_to_slice", since = "1.4.0")]
+    #[inline]
     pub fn as_slice(&self) -> &'a [T] {
         self.make_slice()
     }
@@ -143,6 +144,7 @@ fn is_sorted_by<F>(self, mut compare: F) -> bool
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> Clone for Iter<'_, T> {
+    #[inline]
     fn clone(&self) -> Self {
         Iter { ptr: self.ptr, end: self.end, _marker: self._marker }
     }
@@ -150,6 +152,7 @@ fn clone(&self) -> Self {
 
 #[stable(feature = "slice_iter_as_ref", since = "1.13.0")]
 impl<T> AsRef<[T]> for Iter<'_, T> {
+    #[inline]
     fn as_ref(&self) -> &[T] {
         self.as_slice()
     }
@@ -297,6 +300,7 @@ pub fn into_slice(self) -> &'a mut [T] {
     /// ```
     #[must_use]
     #[stable(feature = "slice_iter_mut_as_slice", since = "1.53.0")]
+    #[inline]
     pub fn as_slice(&self) -> &[T] {
         self.make_slice()
     }
@@ -345,6 +349,7 @@ pub fn as_mut_slice(&mut self) -> &mut [T] {
 
 #[stable(feature = "slice_iter_mut_as_slice", since = "1.53.0")]
 impl<T> AsRef<[T]> for IterMut<'_, T> {
+    #[inline]
     fn as_ref(&self) -> &[T] {
         self.as_slice()
     }