]> git.lizzy.rs Git - rust.git/commitdiff
Following #74010 by converting some newer cases of backticked O notations to be itali...
authorRyan Scott <ryan@ryan-scott.me>
Wed, 14 Oct 2020 05:58:59 +0000 (16:58 +1100)
committerRyan Scott <rscott@zendesk.com>
Thu, 15 Oct 2020 12:21:26 +0000 (23:21 +1100)
library/alloc/src/raw_vec.rs
library/alloc/src/vec.rs
library/core/src/str/traits.rs

index 1844d3ae004f4dbbbbad92543d19367a8da1ad39..7c834f034c1f157d1035caba65bfe49b14df201d 100644 (file)
@@ -259,7 +259,7 @@ fn current_memory(&self) -> Option<(NonNull<u8>, Layout)> {
     /// Ensures that the buffer contains at least enough space to hold `len +
     /// additional` elements. If it doesn't already have enough capacity, will
     /// reallocate enough space plus comfortable slack space to get amortized
-    /// `O(1)` behavior. Will limit this behavior if it would needlessly cause
+    /// *O*(1) behavior. Will limit this behavior if it would needlessly cause
     /// itself to panic.
     ///
     /// If `len` exceeds `self.capacity()`, this may fail to actually allocate
index 5e68f76693fcf6b1e1bd1058a2acf8d267016393..808adb5d47cc7e90415fd374cdc18d059014a06b 100644 (file)
 /// `Vec` does not guarantee any particular growth strategy when reallocating
 /// when full, nor when [`reserve`] is called. The current strategy is basic
 /// and it may prove desirable to use a non-constant growth factor. Whatever
-/// strategy is used will of course guarantee `O(1)` amortized [`push`].
+/// strategy is used will of course guarantee *O*(1) amortized [`push`].
 ///
 /// `vec![x; n]`, `vec![a, b, c, d]`, and
 /// [`Vec::with_capacity(n)`][`Vec::with_capacity`], will all produce a `Vec`
index 4f8aa246e52322fbfd6992bb57c21a7e33f7af0a..af1ce007e8b7c826ab8e827f67151b6a2dfda532 100644 (file)
@@ -89,7 +89,7 @@ fn str_index_overflow_fail() -> ! {
 /// self`. Equivalent to `&self[0 .. len]` or `&mut self[0 .. len]`. Unlike
 /// other indexing operations, this can never panic.
 ///
-/// This operation is `O(1)`.
+/// This operation is *O*(1).
 ///
 /// Prior to 1.20.0, these indexing operations were still supported by
 /// direct implementation of `Index` and `IndexMut`.
@@ -130,7 +130,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
 /// Returns a slice of the given string from the byte range
 /// [`begin`, `end`).
 ///
-/// This operation is `O(1)`.
+/// This operation is *O*(1).
 ///
 /// Prior to 1.20.0, these indexing operations were still supported by
 /// direct implementation of `Index` and `IndexMut`.
@@ -237,7 +237,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
 /// Returns a slice of the given string from the byte range [`0`, `end`).
 /// Equivalent to `&self[0 .. end]` or `&mut self[0 .. end]`.
 ///
-/// This operation is `O(1)`.
+/// This operation is *O*(1).
 ///
 /// Prior to 1.20.0, these indexing operations were still supported by
 /// direct implementation of `Index` and `IndexMut`.
@@ -308,7 +308,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
 /// `len`). Equivalent to `&self[begin .. len]` or `&mut self[begin ..
 /// len]`.
 ///
-/// This operation is `O(1)`.
+/// This operation is *O*(1).
 ///
 /// Prior to 1.20.0, these indexing operations were still supported by
 /// direct implementation of `Index` and `IndexMut`.
@@ -385,7 +385,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
 /// self[begin .. end + 1]`, except if `end` has the maximum value for
 /// `usize`.
 ///
-/// This operation is `O(1)`.
+/// This operation is *O*(1).
 ///
 /// # Panics
 ///
@@ -441,7 +441,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
 /// Equivalent to `&self [0 .. end + 1]`, except if `end` has the maximum
 /// value for `usize`.
 ///
-/// This operation is `O(1)`.
+/// This operation is *O*(1).
 ///
 /// # Panics
 ///