Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I
by saosebastiao on Friday August 19, 2016 @02:45PM
(#12322422)
Wouldn't the type guarantees provided by rusts type system allow for different implementations based on whether it was called on value types vs reference types? I thought there was an auto specialization feature created a while ago that did something like that.
[ Parent
| on HN ]
Re:Writing a JPEG Decoder in Rust – Part 2: Implementation I
by Tuna-Fish on Friday August 19, 2016 @03:37PM
(#12322884)
It allows changing implementation depending on what you pass it, but it cannot change how you pass things. The issue is that if you just call zip(code_lengths), then ownership of code_lengths is passed into the function and it ceases to work in it's parent.