Skip to content

Commit 14aef3d

Browse files
committed
Use with_capacity(0) because we're reading the capacity later on
1 parent 5b16abe commit 14aef3d

File tree

1 file changed

+1
-1
lines changed
  • std/src/sys/pal/unix

1 file changed

+1
-1
lines changed

std/src/sys/pal/unix/os.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ pub fn page_size() -> usize {
706706
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/confstr.html
707707
#[cfg(target_vendor = "apple")]
708708
fn confstr(key: c_int, size_hint: Option<usize>) -> io::Result<OsString> {
709-
let mut buf: Vec<u8> = Vec::new();
709+
let mut buf: Vec<u8> = Vec::with_capacity(0);
710710
let mut bytes_needed_including_nul = size_hint
711711
.unwrap_or_else(|| {
712712
// Treat "None" as "do an extra call to get the length". In theory

0 commit comments

Comments
 (0)