rearrange to be panic safe
rearrange to be panic safe

Signed-off-by: tabokie <9573dceb6ead9846c7438fed8e7eb148b78d187d@outlook.com>

graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust