|
|
|
|
|
by mcpherrinm
4686 days ago
|
|
Rust does have some new syntax, but I think most of it is justified for making programming in it nicer. The `~[u8]` would be written `std::unique_ptr<u8>` in C++. They're used everywhere in Rust, and having to write out unique_ptr would get awfully tiresome. The `acc` on its own line is a result of "the last statement gets returned" like many functional languages do. If you were writing C++, you'd write `return acc;` instead. This one is more of a convenience, and you could get away without it. |
|
Wouldn't it be `std::unique_ptr<std::vector<u8>>`?