clippy: use is_null to check for null pointers

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-01-20 11:38:24 +01:00
parent 1d928b25fe
commit 50deb0d3f8
1 changed files with 4 additions and 4 deletions

View File

@ -126,7 +126,7 @@ impl FixedIndexReader {
} }
fn unmap(&mut self) -> Result<(), Error> { fn unmap(&mut self) -> Result<(), Error> {
if self.index == std::ptr::null_mut() { if self.index.is_null() {
return Ok(()); return Ok(());
} }
@ -324,7 +324,7 @@ impl FixedIndexWriter {
} }
fn unmap(&mut self) -> Result<(), Error> { fn unmap(&mut self) -> Result<(), Error> {
if self.index == std::ptr::null_mut() { if self.index.is_null() {
return Ok(()); return Ok(());
} }
@ -342,7 +342,7 @@ impl FixedIndexWriter {
} }
pub fn close(&mut self) -> Result<[u8; 32], Error> { 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."); 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."); bail!("cannot write to closed index file.");
} }