From 2bec884571839ae06fed2a131536fc39c098cddd Mon Sep 17 00:00:00 2001 From: Marieke Westendorp Date: Fri, 9 Feb 2024 10:16:02 +0100 Subject: [PATCH] Replace fallible conversion to be infallible --- src/structure.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structure.rs b/src/structure.rs index 054e3d3..58a4668 100644 --- a/src/structure.rs +++ b/src/structure.rs @@ -135,8 +135,8 @@ impl Structure { .expect("end of file before all atoms have been specified"); let atom = Atom { resnum: line[0..5].trim().parse().expect("bad resnum integer"), - resname: line[5..10].trim().try_into().unwrap(), // We know that the length <= 5. - atomname: line[10..15].trim().try_into().unwrap(), + resname: line[5..10].trim().into(), + atomname: line[10..15].trim().into(), atomnum: line[15..20].trim().parse().expect("bad atomnum integer"), position: { [&line[20..28], &line[28..36], &line[36..44]] -- 2.45.2