As a response to Issue #15753. Not yet complete.
Some notes:
- All Rust translations assume the crate root (so the reference to
stdis freely available). The use of any other crates is noted. - Every string or vector argument is assumed to be a slice (
&stror&[T]). Otherwise you need to convertStringorVec<T>to a slice with.as_slice()method.
assert(cond):assert!(cond)macro. Note that it's always enabled; if you need to selectively disable the assertions, usedebug_assert!(cond)macro.