-
Notifications
You must be signed in to change notification settings - Fork 298
Open
Description
This would be heavily breaking, and may not be worth it, however I think there's a chance it could offer a lot of benefits, especially now that the conversion traits exist (they never used to when conrod first existed).
pub struct Point {
pub xy: [Scalar; 2],
}
Pros
- It could easily convert between
[Scalar; 2]
and(Scalar, Scalar)
by implingFrom<[Scalar; 2]>
,From<(Scalar, Scalar)>
,Into<[Scalar; 2]>
,Into<(Scalar, Scalar)>
- We could implement the
ops
traits for it (we currently have to usevec2_add(a, b)
which is ok though a little unwieldy at times as it requires an import and thevecmath
crate. - Stronger type safety. If we were to do the same for
Dimensions
, it would be much harder to accidentally pass arguments the wrong way around (which I have done a couple times heh). - We can add any convenience methods as we think of them.
Cons
- It would be a heavily breaking change.
- Would require quite a bit of work, though it would generally be very easy work.