about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-20 10:19:58 +0000
committerbors <bors@rust-lang.org>2020-07-20 10:19:58 +0000
commit71384101ea3b030b80f7def80a37f67e148518b0 (patch)
treeb2cdb190bf396f3b8fc7ffb65e6b0145d27bfd9d /src/librustc_data_structures
parent05630b06fdf76c25c6ccf2e9ac3567592eae6c67 (diff)
parent76b8420168a2e14abf025a07ee4e32d87956d940 (diff)
downloadrust-71384101ea3b030b80f7def80a37f67e148518b0.tar.gz
rust-71384101ea3b030b80f7def80a37f67e148518b0.zip
Auto merge of #74010 - pierwill:pierwill-o-notation, r=GuillaumeGomez
Use italics for O notation

In documentation, I think it makes sense to italicize O notation (*O(n)*) as opposed to using back-ticks (`O(n)`). Visually, back-ticks focus the reader on the literal characters being used, making them ideal for representing code. Using italics, as far I can tell, more closely follows typographic conventions in mathematics and computer science.

Just a suggestion, of course! 😇
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/sorted_map/index_map.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_data_structures/sorted_map/index_map.rs b/src/librustc_data_structures/sorted_map/index_map.rs
index b7005ccdc99..2bb421a47ef 100644
--- a/src/librustc_data_structures/sorted_map/index_map.rs
+++ b/src/librustc_data_structures/sorted_map/index_map.rs
@@ -7,8 +7,8 @@ use std::iter::FromIterator;
 use crate::stable_hasher::{HashStable, StableHasher};
 use rustc_index::vec::{Idx, IndexVec};
 
-/// An indexed multi-map that preserves insertion order while permitting both `O(log n)` lookup of
-/// an item by key and `O(1)` lookup by index.
+/// An indexed multi-map that preserves insertion order while permitting both *O*(log *n*) lookup of
+/// an item by key and *O*(1) lookup by index.
 ///
 /// This data structure is a hybrid of an [`IndexVec`] and a [`SortedMap`]. Like `IndexVec`,
 /// `SortedIndexMultiMap` assigns a typed index to each item while preserving insertion order.
@@ -20,7 +20,7 @@ use rustc_index::vec::{Idx, IndexVec};
 /// items will be yielded in insertion order.
 ///
 /// Unlike a general-purpose map like `BTreeSet` or `HashSet`, `SortedMap` and
-/// `SortedIndexMultiMap` require `O(n)` time to insert a single item. This is because we may need
+/// `SortedIndexMultiMap` require *O*(*n*) time to insert a single item. This is because we may need
 /// to insert into the middle of the sorted array. Users should avoid mutating this data structure
 /// in-place.
 ///