clippy: use is_null to check for null pointers
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
1d928b25fe
commit
50deb0d3f8
@ -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.");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user