Skip to content

Commit 72a8633

Browse files
committed
docs(GH-118094): make docs a bit more explicit
Signed-off-by: Petr Portnov <[email protected]>
1 parent 91fcdde commit 72a8633

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/alloc/src/vec/spec_from_elem.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ impl SpecFromElem for u8 {
6161
}
6262

6363
// A better way would be to implement this for all ZSTs which are `Copy` and have trivial `Clone`
64-
// but this cannot be implemented currently
64+
// but the latter cannot be detected currently
6565
impl SpecFromElem for () {
6666
#[inline]
6767
fn from_elem<A: Allocator>(_elem: (), n: usize, alloc: A) -> Vec<(), A> {
6868
let mut v = Vec::with_capacity_in(n, alloc);
69-
// SAFETY: the capacity has just been set to `n` and `()`
70-
// is a ZST with trivial `Clone` implementation
69+
// SAFETY: the capacity has just been set to `n`
70+
// and `()` is a ZST with trivial `Clone` implementation
7171
unsafe {
7272
v.set_len(n);
7373
}

0 commit comments

Comments
 (0)