4 ms·
No, that’s the unchecked version. Two people are telling you that this method exists and is safe, so I am not sure why you’re still doubting this lol.
by Cyph0n 9mo ago
No, that’s the unchecked version. Two people are telling you that this method exists and is safe, so I am not sure why you’re still doubting this lol.
- bmandale 9mo agoThe checked variant just calls the unchecked, and the panicking variant calls the checked variant. They all need to call unsafe code. See here for details: https://doc.rust-lang.org/nomicon/borrow-splitting.html https://doc.rust-lang.org/nomicon/borrow-splitting.html
- Cyph0n 9mo agoThen you misunderstand what unsafe means in Rust. Every single Rust binary needs to eventually call unsafe code at some layer of the callstack. Is creating a TCP socket using stdlib functions unsafe? How about writing to a file? Or acquiring a mutex? I would suggest doing some more reading before chiming in here :)