bevy/crates/bevy_math/src
Matty Weatherley 9d142a8025
Use IntoIterator instead of Into<Vec<..>> in cubic splines interfaces (#16402)
# Objective

This was always a bit weird; `IntoIterator` is considered more idiomatic
in Rust.

The reason these used `Into<Vec<..>>` in the first place was (to my
knowledge) because of concerns that passing an already-owned vector
would cause a redundant allocation if the iterator API was used instead.
However, I have looked at simple examples for this scenario and the
generated assembly is identical (i.e. `into_iter().collect()` is
effectively converted to a no-op).

## Solution

As described in the title.

## Testing

It compiles. Ran existing tests.

## Migration Guide

The cubic splines API now uses `IntoIterator` in places where it used
`Into<Vec<..>>`. For most users, this will have little to no effect (it
is largely more permissive). However, in case you were using some
unusual input type that implements `Into<Vec<..>>` without implementing
`IntoIterator`, you can migrate by converting the input to a `Vec<..>`
before passing it into the interface.
2024-12-03 19:35:14 +00:00
..
bounding Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
curve Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
primitives Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
rects Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
sampling Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
affine3.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
aspect_ratio.rs feat: mark some functions in bevy_math as const (#16439) 2024-11-22 18:26:47 +00:00
common_traits.rs Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
compass.rs Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
cubic_splines.rs Use IntoIterator instead of Into<Vec<..>> in cubic splines interfaces (#16402) 2024-12-03 19:35:14 +00:00
direction.rs Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
float_ord.rs Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
isometry.rs Implement From translation and rotation for isometries (#15733) 2024-10-08 16:09:28 +00:00
lib.rs Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
ops.rs Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
ray.rs Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
rotation2d.rs Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00