From 48bf8681bc456e17fbb31606b27d0b396332f0f5 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Tue, 8 Nov 2022 13:42:07 +0100 Subject: [PATCH] clippy fix --- crates/repl_expect/src/run.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/repl_expect/src/run.rs b/crates/repl_expect/src/run.rs index d6b7921e1a..2ec241aca6 100644 --- a/crates/repl_expect/src/run.rs +++ b/crates/repl_expect/src/run.rs @@ -63,10 +63,10 @@ impl<'a> ExpectMemory<'a> { if libc::fstat(shared_fd, &mut stat) == -1 { internal_error!("failed to stat shared file, does it exist?"); } - if stat.st_size < Self::SHM_SIZE as _ { - if libc::ftruncate(shared_fd, Self::SHM_SIZE as _) == -1 { - internal_error!("failed to truncate shared file, are the permissions wrong?"); - } + if stat.st_size < Self::SHM_SIZE as _ + && libc::ftruncate(shared_fd, Self::SHM_SIZE as _) == -1 + { + internal_error!("failed to truncate shared file, are the permissions wrong?"); } let ptr = libc::mmap(