about summary refs log tree commit diff
path: root/src/libstd
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/libstd
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/libstd')
-rw-r--r--src/libstd/collections/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/collections/mod.rs b/src/libstd/collections/mod.rs
index cc6663bebd3..b6488ae61b1 100644
--- a/src/libstd/collections/mod.rs
+++ b/src/libstd/collections/mod.rs
@@ -86,7 +86,7 @@
 //! cost are suffixed with a `~`.
 //!
 //! All amortized costs are for the potential need to resize when capacity is
-//! exhausted. If a resize occurs it will take O(n) time. Our collections never
+//! exhausted. If a resize occurs it will take *O*(*n*) time. Our collections never
 //! automatically shrink, so removal operations aren't amortized. Over a
 //! sufficiently large series of operations, the average cost per operation will
 //! deterministically equal the given cost.