From e3aca01343a06b3871b3b0f920c91f95be54a6d9 Mon Sep 17 00:00:00 2001 From: Gurinder Singh Date: Fri, 29 Dec 2023 09:53:29 +0530 Subject: [PATCH] Italicise "bytes" in the docs of some `Vec` methods because on a cursory read it's easy to miss that the limit is in terms of bytes not no. of elements. The italics should help with that. --- library/alloc/src/raw_vec.rs | 4 ++-- library/alloc/src/vec/mod.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs index 99ec68f5aa5..74fa30456eb 100644 --- a/library/alloc/src/raw_vec.rs +++ b/library/alloc/src/raw_vec.rs @@ -284,7 +284,7 @@ fn current_memory(&self) -> Option<(NonNull, Layout)> { /// /// # Panics /// - /// Panics if the new capacity exceeds `isize::MAX` bytes. + /// Panics if the new capacity exceeds `isize::MAX` _bytes_. /// /// # Aborts /// @@ -342,7 +342,7 @@ pub fn try_reserve(&mut self, len: usize, additional: usize) -> Result<(), TryRe /// /// # Panics /// - /// Panics if the new capacity exceeds `isize::MAX` bytes. + /// Panics if the new capacity exceeds `isize::MAX` _bytes_. /// /// # Aborts /// diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index fca85c6123b..e8a096cac86 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -445,7 +445,7 @@ pub const fn new() -> Self { /// /// # Panics /// - /// Panics if the new capacity exceeds `isize::MAX` bytes. + /// Panics if the new capacity exceeds `isize::MAX` _bytes_. /// /// # Examples /// @@ -633,7 +633,7 @@ pub const fn new_in(alloc: A) -> Self { /// /// # Panics /// - /// Panics if the new capacity exceeds `isize::MAX` bytes. + /// Panics if the new capacity exceeds `isize::MAX` _bytes_. /// /// # Examples /// @@ -896,7 +896,7 @@ pub fn capacity(&self) -> usize { /// /// # Panics /// - /// Panics if the new capacity exceeds `isize::MAX` bytes. + /// Panics if the new capacity exceeds `isize::MAX` _bytes_. /// /// # Examples /// @@ -926,7 +926,7 @@ pub fn reserve(&mut self, additional: usize) { /// /// # Panics /// - /// Panics if the new capacity exceeds `isize::MAX` bytes. + /// Panics if the new capacity exceeds `isize::MAX` _bytes_. /// /// # Examples /// @@ -1900,7 +1900,7 @@ fn drop(&mut self) { /// /// # Panics /// - /// Panics if the new capacity exceeds `isize::MAX` bytes. + /// Panics if the new capacity exceeds `isize::MAX` _bytes_. /// /// # Examples /// @@ -2003,7 +2003,7 @@ pub fn pop(&mut self) -> Option { /// /// # Panics /// - /// Panics if the new capacity exceeds `isize::MAX` bytes. + /// Panics if the new capacity exceeds `isize::MAX` _bytes_. /// /// # Examples ///