Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Mercurial’s journey to and reflections on Python 3. Parent comment
https://doc.rust-lang.org/std/string/struct.String.html#meth...
https://doc.rust-lang.org/std/primitive.str.html#method.as_b...
https://doc.rust-lang.org/std/str/fn.from_utf8.html
Also, as explained in those docs, if and when you are absolutely sure that the Vec or slice of bytes is valid UTF-8, you could use the following "unsafe" methods to not incur the overhead of validation (warnings in the docs):
https://doc.rust-lang.org/std/str/fn.from_utf8_unchecked.htm...
There are no comments on this comment yet.
https://doc.rust-lang.org/std/string/struct.String.html#meth...
https://doc.rust-lang.org/std/string/struct.String.html#meth...
https://doc.rust-lang.org/std/primitive.str.html#method.as_b...
https://doc.rust-lang.org/std/str/fn.from_utf8.html
Also, as explained in those docs, if and when you are absolutely sure that the Vec or slice of bytes is valid UTF-8, you could use the following "unsafe" methods to not incur the overhead of validation (warnings in the docs):
https://doc.rust-lang.org/std/string/struct.String.html#meth...
https://doc.rust-lang.org/std/str/fn.from_utf8_unchecked.htm...