From 50deb0d3f8dafd2751236c16b8f730190d67f957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 20 Jan 2021 11:38:24 +0100 Subject: [PATCH] clippy: use is_null to check for null pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- src/backup/fixed_index.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backup/fixed_index.rs b/src/backup/fixed_index.rs index 279537de..5eb7f04a 100644 --- a/src/backup/fixed_index.rs +++ b/src/backup/fixed_index.rs @@ -126,7 +126,7 @@ impl FixedIndexReader { } fn unmap(&mut self) -> Result<(), Error> { - if self.index == std::ptr::null_mut() { + if self.index.is_null() { return Ok(()); } @@ -324,7 +324,7 @@ impl FixedIndexWriter { } fn unmap(&mut self) -> Result<(), Error> { - if self.index == std::ptr::null_mut() { + if self.index.is_null() { return Ok(()); } @@ -342,7 +342,7 @@ impl FixedIndexWriter { } pub fn close(&mut self) -> Result<[u8; 32], Error> { - if self.index == std::ptr::null_mut() { + if self.index.is_null() { bail!("cannot close already closed index file."); } @@ -437,7 +437,7 @@ impl FixedIndexWriter { ); } - if self.index == std::ptr::null_mut() { + if self.index.is_null() { bail!("cannot write to closed index file."); }