fix: remove leftover assume_init call

This commit is contained in:
Anna 2023-08-31 15:59:34 -04:00
parent fae00a0a34
commit fae08c0d5d
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 5 additions and 9 deletions

View File

@ -1,7 +1,6 @@
use std::borrow::Cow;
use std::fs::File;
use std::io::{ErrorKind, Write};
use std::mem::MaybeUninit;
use std::process::Command;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, AtomicI64, AtomicUsize, Ordering};
@ -505,8 +504,7 @@ fn main() -> Result<()> {
let mut first = true;
while !found.load(Ordering::Relaxed) {
let mut append = None;
let mut header = MaybeUninit::uninit();
if !signing {
let mut header = if !signing {
append = match method {
Method::Random => {
rand::thread_rng().fill(&mut random_bytes);
@ -551,15 +549,13 @@ fn main() -> Result<()> {
line.push_str(buffer.format(count));
}
header.write(match method {
match method {
Method::Counter | Method::Random => Cow::from(&stripped_header),
_ => Cow::from(header_lines.join("\n")),
});
}
} else {
header.write(Cow::from(&stripped_header));
}
let mut header = unsafe { header.assume_init() };
Cow::from(&stripped_header)
};
// NOTE: don't need to handle append here, since we'll never be
// both appending *and* signing