Skip to content

Commit

Permalink
Direct collect boxed slices
Browse files Browse the repository at this point in the history
Co-authored-by: ira <[email protected]>
  • Loading branch information
MrGVSV and tim-blackbird authored Oct 17, 2022
1 parent 7bd305d commit 14f5def
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_reflect/src/enums/enum_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ impl EnumInfo {
let variant_names = variants
.iter()
.map(|variant| variant.name())
.collect::<Vec<_>>();
.collect();

Self {
name,
type_name: std::any::type_name::<TEnum>(),
type_id: TypeId::of::<TEnum>(),
variants: variants.to_vec().into_boxed_slice(),
variant_names: variant_names.into_boxed_slice(),
variant_names,
variant_indices,
}
}
Expand Down

0 comments on commit 14f5def

Please sign in to comment.