From fa7e95dc49033633b3e6eba44a624ff78f890b5c Mon Sep 17 00:00:00 2001 From: agentelement Date: Wed, 7 Jan 2026 11:50:16 -0700 Subject: [PATCH] chore: clippy lints --- src/python.rs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/python.rs b/src/python.rs index e9a1cb74..14856c6d 100644 --- a/src/python.rs +++ b/src/python.rs @@ -280,11 +280,7 @@ fn make_boundlist(pybounds: &[PyBound]) -> Vec { #[pyfunction(name = "mol_info")] pub fn _mol_info(mol_block: &str) -> PyResult { // Parse the .mol file contents as a molecule::Molecule. - let mol_result = parse_molfile_str(mol_block); - let mol = match mol_result { - Ok(mol) => mol, - Err(e) => return Err(e.into()), // Convert the error to PyErr - }; + let mol = parse_molfile_str(mol_block)?; // Return molecule info. Ok(mol.info()) @@ -316,11 +312,7 @@ pub fn _mol_info(mol_block: &str) -> PyResult { #[pyfunction(name = "depth")] pub fn _depth(mol_block: &str) -> PyResult { // Parse the .mol file contents as a molecule::Molecule. - let mol_result = parse_molfile_str(mol_block); - let mol = match mol_result { - Ok(mol) => mol, - Err(e) => return Err(e.into()), // Convert the error to PyErr - }; + let mol = parse_molfile_str(mol_block)?; // Calculate assembly depth. Ok(depth(&mol)) @@ -351,11 +343,7 @@ pub fn _depth(mol_block: &str) -> PyResult { #[pyfunction(name = "index")] pub fn _index(mol_block: &str) -> PyResult { // Parse the .mol file contents as a molecule::Molecule. - let mol_result = parse_molfile_str(mol_block); - let mol = match mol_result { - Ok(mol) => mol, - Err(e) => return Err(e.into()), // Convert the error to PyErr - }; + let mol = parse_molfile_str(mol_block)?; // Calculate the assembly index. Ok(index(&mol)) @@ -428,11 +416,7 @@ pub fn _index_search( bound_strs: Vec, ) -> PyResult<(u32, u32, Option)> { // Parse the .mol file contents as a molecule::Molecule. - let mol_result = parse_molfile_str(mol_block); - let mol = match mol_result { - Ok(mol) => mol, - Err(e) => return Err(e.into()), // Convert the error to PyErr - }; + let mol = parse_molfile_str(mol_block)?; // Parse the various modes and bound options. let canonize_mode = match PyCanonizeMode::from_str(canonize_str) {