I'm not sure I see the value in this. The standard library is allowed to do things that cannot be done outside the standard library. And in the original topic suggestion, the interface itself is unchanged. I do not agree with the reasoning "An external crate cannot be optimized this way, so we should not optimize the standard library this way." Of course there could be other reasons not to do this, for example the optimization's implementation might be too hairy and not worth the development/maintenance cost. But if something in the standard library can be optimized with internal magic and the cost/benefit ratio is in favour of the optimization, I think it should be.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Feature request: std::fmt::Write::write_line | 19 | 1351 | September 22, 2021 | |
Missing optimization of write!() with string literal | 3 | 767 | March 25, 2019 | |
Changing core::fmt for speed | 9 | 3672 | March 25, 2019 | |
Writeln!() macro missing important import | 4 | 3423 | March 27, 2019 | |
Add an easier way to append `T: Display` to `String` to stdlib? | 26 | 2613 | October 27, 2019 |