|
|
|
|
|
by Ar-Curunir
271 days ago
|
|
This is an issue that you would face in any language with strong typing.
It only rears its head in Rust because Rust tries to give you both low-level control and strong types. For example, in something like Go (which has a weaker type system than Rust), you wouldn't think twice about, paying for the re-allocation in buffer-reuse example. Of course, in something like C or C++ you could do these things via simple pointer casts, but then you run the risk of violating some undefined behaviour. |
|