From b81f944984a58af804e50d0544d143589582a4fe Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Tue, 10 Feb 2026 09:56:44 +0000 Subject: [PATCH] Replace unimplemented!() with unreachable!() for null pointer after success These branches handle the case where cfitsio returns success but a null pointer, which should be impossible. Using unreachable!() better conveys this intent, while unimplemented!() misleadingly suggests a missing feature. Co-Authored-By: Claude Opus 4.6 --- fitsio/src/fitsfile.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fitsio/src/fitsfile.rs b/fitsio/src/fitsfile.rs index 3efb599d..b20b5a72 100644 --- a/fitsio/src/fitsfile.rs +++ b/fitsio/src/fitsfile.rs @@ -66,7 +66,7 @@ impl FitsFile { open_mode: FileOpenMode::READONLY, file_path: file_path.to_path_buf(), }, - None => unimplemented!(), + None => unreachable!("cfitsio returned success but a null pointer"), }) } @@ -108,7 +108,7 @@ impl FitsFile { open_mode: FileOpenMode::READWRITE, file_path: file_path.to_path_buf(), }, - None => unimplemented!(), + None => unreachable!("cfitsio returned success but a null pointer"), }) } @@ -930,7 +930,7 @@ where open_mode: FileOpenMode::READWRITE, file_path: file_path.to_path_buf(), }, - None => unimplemented!(), + None => unreachable!("cfitsio returned success but a null pointer"), }; match self.image_description {