diff --git a/src/rbx.rs b/src/rbx.rs index 76e5861..46b5476 100644 --- a/src/rbx.rs +++ b/src/rbx.rs @@ -63,7 +63,7 @@ impl ModesBuilder{ //collect modes and stages into contiguous arrays let mut unique_modes:Vec<(gameplay_modes::ModeId,gameplay_modes::Mode)> =self.modes.into_iter().collect(); - unique_modes.sort_by(|a,b|a.0.cmp(&b.0)); + unique_modes.sort_by_key(|&(mode_id,_)|mode_id); let (mut modes,final_mode_id_from_builder_mode_id):(Vec,HashMap) =unique_modes.into_iter().enumerate() .map(|(final_mode_id,(builder_mode_id,mut mode))|{