moonbitlang / core

MoonBit's Core library
https://moonbitlang.com/
Apache License 2.0
584 stars 72 forks source link

Proposal: Modify FixedArray::from_array to Accept Array as Parameter #534

Closed KKKIIO closed 3 months ago

KKKIIO commented 3 months ago

Currently, FixedArray::from_array accepts a FixedArray and returns it immediately, which is somewhat confusing and gives the impression that it functions more like ImmutableVec.

To improve consistency with other standard library container functions (e.g., HashMap::from_array), I propose that FixedArray::from_array should accept an Array and return a FixedArray. This change would enhance the overall coherence of the API.