Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces new helper methods to make some common patterns less verbose.
xs.items.add(i)->xs.at(i)*mut Tinstead ofTto allow assignment like*xs.at(i) = x;.getwould imply returning a value).da_*function requires adding aCopyconstraint toT,but this should be fine as crust™ requires all types to be
Clone + Copy.for i in 0..xs.count { let x = *xs.at(i); /*...*/ }->for x in xs.iter() { /*...*/ }T).for i in 0..xs.count { let x = xs.at(i); /*...*/ }->for x in xs.iter_mut() { /*...*/ }*mut T, can implicitly convert to*const T).existing functions like
da_lastandda_last_mutcan be turned into methods but I kept them as-is for backwards compatibility (da_appendwould be tricky to get working as a method without references).The last commit is more or less an excuse for me to use
Array::iter()more, feel free to drop it if you feel it's unnecessary.