Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8446d94

Browse files
committedOct 15, 2020
Following rust-lang#74010 by converting some newer cases of backticked O notations to be italicized
1 parent 000ec5e commit 8446d94

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed
 

Diff for: ‎library/alloc/src/raw_vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
259259
/// Ensures that the buffer contains at least enough space to hold `len +
260260
/// additional` elements. If it doesn't already have enough capacity, will
261261
/// reallocate enough space plus comfortable slack space to get amortized
262-
/// `O(1)` behavior. Will limit this behavior if it would needlessly cause
262+
/// *O*(1) behavior. Will limit this behavior if it would needlessly cause
263263
/// itself to panic.
264264
///
265265
/// If `len` exceeds `self.capacity()`, this may fail to actually allocate

Diff for: ‎library/alloc/src/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ use crate::raw_vec::RawVec;
259259
/// `Vec` does not guarantee any particular growth strategy when reallocating
260260
/// when full, nor when [`reserve`] is called. The current strategy is basic
261261
/// and it may prove desirable to use a non-constant growth factor. Whatever
262-
/// strategy is used will of course guarantee `O(1)` amortized [`push`].
262+
/// strategy is used will of course guarantee *O*(1) amortized [`push`].
263263
///
264264
/// `vec![x; n]`, `vec![a, b, c, d]`, and
265265
/// [`Vec::with_capacity(n)`][`Vec::with_capacity`], will all produce a `Vec`

Diff for: ‎library/core/src/str/traits.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fn str_index_overflow_fail() -> ! {
8989
/// self`. Equivalent to `&self[0 .. len]` or `&mut self[0 .. len]`. Unlike
9090
/// other indexing operations, this can never panic.
9191
///
92-
/// This operation is `O(1)`.
92+
/// This operation is *O*(1).
9393
///
9494
/// Prior to 1.20.0, these indexing operations were still supported by
9595
/// direct implementation of `Index` and `IndexMut`.
@@ -130,7 +130,7 @@ unsafe impl SliceIndex<str> for ops::RangeFull {
130130
/// Returns a slice of the given string from the byte range
131131
/// [`begin`, `end`).
132132
///
133-
/// This operation is `O(1)`.
133+
/// This operation is *O*(1).
134134
///
135135
/// Prior to 1.20.0, these indexing operations were still supported by
136136
/// direct implementation of `Index` and `IndexMut`.
@@ -237,7 +237,7 @@ unsafe impl SliceIndex<str> for ops::Range<usize> {
237237
/// Returns a slice of the given string from the byte range [`0`, `end`).
238238
/// Equivalent to `&self[0 .. end]` or `&mut self[0 .. end]`.
239239
///
240-
/// This operation is `O(1)`.
240+
/// This operation is *O*(1).
241241
///
242242
/// Prior to 1.20.0, these indexing operations were still supported by
243243
/// direct implementation of `Index` and `IndexMut`.
@@ -308,7 +308,7 @@ unsafe impl SliceIndex<str> for ops::RangeTo<usize> {
308308
/// `len`). Equivalent to `&self[begin .. len]` or `&mut self[begin ..
309309
/// len]`.
310310
///
311-
/// This operation is `O(1)`.
311+
/// This operation is *O*(1).
312312
///
313313
/// Prior to 1.20.0, these indexing operations were still supported by
314314
/// direct implementation of `Index` and `IndexMut`.
@@ -385,7 +385,7 @@ unsafe impl SliceIndex<str> for ops::RangeFrom<usize> {
385385
/// self[begin .. end + 1]`, except if `end` has the maximum value for
386386
/// `usize`.
387387
///
388-
/// This operation is `O(1)`.
388+
/// This operation is *O*(1).
389389
///
390390
/// # Panics
391391
///
@@ -441,7 +441,7 @@ unsafe impl SliceIndex<str> for ops::RangeInclusive<usize> {
441441
/// Equivalent to `&self [0 .. end + 1]`, except if `end` has the maximum
442442
/// value for `usize`.
443443
///
444-
/// This operation is `O(1)`.
444+
/// This operation is *O*(1).
445445
///
446446
/// # Panics
447447
///

0 commit comments

Comments
 (0)
Please sign in to comment.