As a response to Issue #15753. Not yet complete.
Some notes:
- All Rust translations assume the crate root (so the reference to
std
is freely available). The use of any other crates is noted. - Every string or vector argument is assumed to be a slice (
&str
or&[T]
). Otherwise you need to convertString
orVec<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.