4 ms·
> I'd be fine writing `.into()` or `.trunc()` Yes, this is specifically what I'm disagreeing with. > I fully expect that such methods will be inlined, likely
by Rusky 1y ago
> I'd be fine writing `.into()` or `.trunc()`
Yes, this is specifically what I'm disagreeing with.
> I fully expect that such methods will be inlined, likely even in debug mode (e.g. `#[inline(always)]`), and compile down to the same minimal instructions.
That's the cost to compile time I mentioned.
- JoshTriplett 1y agoMany things in the language theoretically go through a trait as well, except that we have special cases in the compiler to handle those traits more efficiently. If this were a performance issue, there's no reason we couldn't do the same for `.trunc()` or `.into()`.