perf: remove unnecessary heap allocation (#7731)

This commit is contained in:
XXIV 2023-09-04 15:00:49 +03:00 committed by GitHub
parent af3268a4be
commit 41067cef00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,7 +242,7 @@ pub fn log_stdout() {
if let Ok(len) = reader.read_line(&mut buffer) {
if len == 0 {
break;
} else if let Ok(msg) = CString::new(buffer.clone())
} else if let Ok(msg) = CString::new(buffer.as_bytes())
.map_err(|_| ())
.and_then(|c| c.into_string().map_err(|_| ()))
{