Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upC-CONV: Uses an inadequate std example #112
Comments
dtolnay
added
edit
clarification
and removed
edit
labels
Sep 18, 2017
dtolnay
added
the
hacktoberfest
label
Oct 1, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks for catching this! The |
dtolnay
closed this
Oct 29, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TheDan64 commentedJul 21, 2017
•
edited
Under the C-CONV section, it states that
to_*methods go from borrowed -> owned and is an expensive operation (usually involving a clone)However, in the "more examples from the std library", it references Path::to_str, which has a signature of
fn to_str(&self) -> Option<&str>. This seems like this method should have actually been namedas_straccording to these guidelines, and is therefore a inadequate example forto_*methods.Edit: Only thing I can think of is maybe it's costly to validate UTF8 from the inner OsStr?