4 ms·
If one is to write such simple code in unsafe mode, might as well just use C! We have https://doc.rust-lang.org/std/primitive.str.html#method.as_bytes https://
by kroltan 9y ago
If one is to write such simple code in unsafe mode, might as well just use C!
We have https://doc.rust-lang.org/std/primitive.str.html#method.as_bytes https://doc.rust-lang.org/std/primitive.str.html#method.as_b... for accessing a str bytewise. No need for pointers and `unsafe`.
The whole point of Rust is being safer and higher-level than C, and if you don't want to use its features, there is no improvement over C.