diff --git a/crates/bevy_reflect/src/list.rs b/crates/bevy_reflect/src/list.rs index 7e139d48b0..6a2c2a8767 100644 --- a/crates/bevy_reflect/src/list.rs +++ b/crates/bevy_reflect/src/list.rs @@ -11,11 +11,15 @@ use crate::{ /// /// This is a sub-trait of [`Array`] as it implements a [`push`](List::push) function, allowing /// it's internal size to grow. +/// +/// This trait expects index 0 to contain the _front_ element. +/// The _back_ element must refer to the element with the largest index. +/// These two rules above should be upheld by manual implementors. pub trait List: Reflect + Array { - /// Appends an element to the list. + /// Appends an element to the _back_ of the list. fn push(&mut self, value: Box); - /// Removes the last element from the list (highest index in the array) and returns it, or [`None`] if it is empty. + /// Removes the _back_ element from the list and returns it, or [`None`] if it is empty. fn pop(&mut self) -> Option>; /// Clones the list, producing a [`DynamicList`].