Open
Description
While #886 was an interesting addition to the library, some of its decisions are dubious in necessity:
- The addition of
gdnative::export::IndexBounds
, whose functionalities largely duplicate the standardstd::ops::RangeBounds
trait. - The use of
TryFrom
for tuple impls, which as opposed to the existingFromVarargs
:- Can only report a single error, instead of all the errors.
- Does not have the same composability (
FromVarargs
types can be chained for common argument sets). - Is unused anywhere else.
- Introduction of a new
VarargsError
type, that:- Does not work with the existing
gdnative::export::ArgumentError
type, but duplicates its functionality instead. - Lacks the ability to be reported with a
Site
. - Is unused anywhere else, anyway.
- Does not work with the existing
- Addition of APIs that needlessly expose internals, and can complicate future changes.
- Method arguments are meant to be accessed sequentially, required ones followed by optional ones.
FromVariant
conversions are meant to be done only once, because otherwise it's just unnecessary inefficiency. AccessingVarargs
in any other way is most certainly a user error, and should not be enabled by the API design. - That
Varargs
is internally a slice should have remained an implementation detail, because there exist reasons why we might want to change that later, like in case we uncovered a source of UB during the conversion.
- Method arguments are meant to be accessed sequentially, required ones followed by optional ones.
We probably want to re-consider how much of these are actually useful to the end user, and deprecate/remove things that are mostly cruft.