Open lo48576 opened 5 years ago
FYI: rgb
crate has ComponentMap
trait to do that.
It sounds fairly straightforward: the feature is generic, doesn't involve any math specifically, and can be implemented with just a few blocks. I think we could have it in scope.
As for ComponentMap
, it's a pretty solution but it doesn't appear to be providing a lot of benefit to mint
since our types don't have any methods that would be confusingly conflict with map
.
I think people (including me) sometimes want to convert
f64
types andf32
types or such component type conversion. For example, downgradingPoint3<f64>
toPoint3<f32>
.These conversions cannot be written using only
From
andInto
trait (because of coherence), so usually it is done by.map()
function. (SeeOption::map
andResult::map
for example.)I'm not sure how this should be implemented in this crate,
.map()
method,Map
trait, or something else...Are these component type conversion in scope of this crate?