about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPetr Portnov <me@progrm-jarvis.ru>2023-11-20 18:35:04 +0300
committerPetr Portnov <me@progrm-jarvis.ru>2023-11-20 18:35:04 +0300
commit72a8633ee8ab8986ab32fb29c2ebd9e2d98c723b (patch)
tree9c1a6eb46ebd85f4ffd2eae59e3189ba1ae8753e
parent91fcdde51b477e8def5e8cca2807a2dc12c8f06d (diff)
downloadrust-72a8633ee8ab8986ab32fb29c2ebd9e2d98c723b.tar.gz
rust-72a8633ee8ab8986ab32fb29c2ebd9e2d98c723b.zip
docs(GH-118094): make docs a bit more explicit
Signed-off-by: Petr Portnov <me@progrm-jarvis.ru>
-rw-r--r--library/alloc/src/vec/spec_from_elem.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/src/vec/spec_from_elem.rs b/library/alloc/src/vec/spec_from_elem.rs
index 63225b41cbd..01a6db14474 100644
--- a/library/alloc/src/vec/spec_from_elem.rs
+++ b/library/alloc/src/vec/spec_from_elem.rs
@@ -61,13 +61,13 @@ impl SpecFromElem for u8 {
 }
 
 // A better way would be to implement this for all ZSTs which are `Copy` and have trivial `Clone`
-// but this cannot be implemented currently
+// but the latter cannot be detected currently
 impl SpecFromElem for () {
     #[inline]
     fn from_elem<A: Allocator>(_elem: (), n: usize, alloc: A) -> Vec<(), A> {
         let mut v = Vec::with_capacity_in(n, alloc);
-        // SAFETY: the capacity has just been set to `n` and `()`
-        // is a ZST with trivial `Clone` implementation
+        // SAFETY: the capacity has just been set to `n`
+        // and `()` is a ZST with trivial `Clone` implementation
         unsafe {
             v.set_len(n);
         }