From d3dee28e9bc380387bcc430a78e3b0581fbdcd6f Mon Sep 17 00:00:00 2001 From: martinfrances107 Date: Wed, 2 Apr 2025 14:45:31 +0100 Subject: [PATCH 1/2] Minor: Simplified - Error generation. All changes are of the form :- ``` - _ => Err(std::io::Error::new(ErrorKind::Other, "only .ply4d and .gc4d supported")), + _ => Err(std::io::Error::other("only .ply4d and .gc4d supported")), ``` --- src/io/loader.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/io/loader.rs b/src/io/loader.rs index 2d667ed8..6642c0b9 100644 --- a/src/io/loader.rs +++ b/src/io/loader.rs @@ -47,7 +47,7 @@ impl AssetLoader for Gaussian3dLoader { #[cfg(not(feature = "io_ply"))] { - Err(std::io::Error::new(ErrorKind::Other, "ply support not enabled, enable with io_ply feature")) + Err(std::io::Error::other("ply support not enabled, enable with io_ply feature")) } }, Some(ext) if ext == "gcloud" => { @@ -55,7 +55,7 @@ impl AssetLoader for Gaussian3dLoader { Ok(cloud) }, - _ => Err(std::io::Error::new(ErrorKind::Other, "only .ply and .gcloud supported")), + _ => Err(std::io::Error::other("only .ply and .gcloud supported")), } } @@ -95,13 +95,13 @@ impl AssetLoader for Gaussian4dLoader { #[cfg(not(feature = "io_ply"))] { - Err(std::io::Error::new(ErrorKind::Other, "ply4d support not enabled, enable with io_ply feature")) + Err(std::io::Error::other("ply4d support not enabled, enable with io_ply feature")) } }, Some(ext) if ext == "gc4d" => { Ok(PlanarGaussian4d::decode(bytes.as_slice())) }, - _ => Err(std::io::Error::new(ErrorKind::Other, "only .ply4d and .gc4d supported")), + _ => Err(std::io::Error::other("only .ply4d and .gc4d supported")), } } From 8b145dc41cdce4755c180544a485d65bc16bcf17 Mon Sep 17 00:00:00 2001 From: martinfrances107 Date: Mon, 7 Apr 2025 08:53:12 +0100 Subject: [PATCH 2/2] Minor: Simplified - Error generation ( part 2 ). --- src/io/scene.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io/scene.rs b/src/io/scene.rs index 20e4f220..a4a53483 100644 --- a/src/io/scene.rs +++ b/src/io/scene.rs @@ -176,7 +176,7 @@ impl AssetLoader for GaussianSceneLoader { Ok(scene) }, - _ => Err(std::io::Error::new(ErrorKind::Other, "only .json supported")), + _ => Err(std::io::Error::other("only .json supported")), } }