rust/src/libcore
Phlosioneer bbd64b2563 Slight modification to the as_ref example of std::option::Option
A user in a reddit thread was confused by the name of the variable
"num_as_int"; they thought the example was trying to convert the
string "10" as if it were binary 2 by calling str::len(). In reality,
the example is simply demonstrating how to take an immutable reference
to the value of an Option. The confusion comes from the coincidence
that the length of the string "10" is also its binary representation,
and the implication from the variable names that a conversion was
occuring ("num_as_str" to "num_as_int").

This PR changes the example number to 12 instead of 10, and changes
the variable name from "num_as_int" to "num_length" to better
communicate what the example is doing.

The reddit thread:
https://www.reddit.com/r/rust/comments/7zpvev/notyetawesome_rust_what_use_cases_would_you_like/dur39xw/
2018-02-24 11:37:38 -05:00
..
benches Auto merge of #45595 - scottmcm:iter-try-fold, r=dtolnay 2017-11-17 07:43:08 +00:00
fmt Add filter to detect local crates for rustc_on_unimplemented 2018-02-01 15:06:21 -08:00
hash Fix broken link markup in Hasher::finish docs 2017-11-10 20:58:03 +01:00
iter Rollup merge of #48157 - scottmcm:try-for-each, r=dtolnay 2018-02-23 10:24:49 -08:00
num Take 2^5 as examples in document of pow() (fixes #48396) 2018-02-21 22:34:45 +09:00
ops Rollup merge of #48151 - echochamber:update_range_example, r=estebank 2018-02-14 18:25:19 +08:00
prelude Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
slice Partially revert #47333. 2018-02-15 00:04:18 +08:00
str spelling fix in comment 2018-02-15 14:44:58 -05:00
sync Force the link to std:🧵:yield_now() 2018-02-16 12:20:54 +01:00
tests Rollup merge of #48156 - Centril:feature/iterator_repeat_with, r=alexcrichton 2018-02-14 18:25:22 +08:00
any.rs stage0 cfg cleanup 2018-02-20 08:52:33 -07:00
array.rs Changed back inline markings. 2018-01-30 05:31:38 -07:00
borrow.rs Update older URLs pointing to the first edition of the Book 2017-06-15 00:04:00 +09:00
Cargo.toml std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
cell.rs Make UnsafeCell::into_inner safe 2018-01-05 01:11:20 +00:00
char.rs derive PartialEq and Eq for ParseCharError 2018-01-26 18:52:27 -05:00
char_private.rs regenerate libcore/char_private.rs 2017-10-26 22:32:24 -07:00
clone.rs Update bootstrap compiler 2017-08-31 06:58:58 -07:00
cmp.rs Derive std::cmp::Reverse as Copy or Clone 2018-01-12 13:18:33 +02:00
convert.rs Fix info about generic impls in AsMut docs 2018-02-04 11:57:36 -08:00
default.rs Fix "Quasi-quoting is inefficient" warning in incremental rustbuild. 2017-07-18 01:49:40 +08:00
internal_macros.rs fix version number 2017-09-21 15:46:17 -04:00
intrinsics.rs copy_nonoverlapping example: Fixed typo 2018-02-02 22:44:14 +02:00
iter_private.rs Various fixes to wording consistency in the docs 2017-03-22 17:19:52 +01:00
lib.rs Auto merge of #47687 - SimonSapin:panic-impl, r=sfackler 2018-02-18 06:02:35 +00:00
macros.rs fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} 2018-02-10 12:22:57 +01:00
marker.rs Review change - Expanded on explanation. 2018-02-14 19:14:25 +00:00
mem.rs Rollup merge of #46156 - SimonSapin:patch-14, r=withoutboats 2018-02-02 16:29:11 +08:00
nonzero.rs Rollup merge of #46287 - SimonSapin:stable-constness, r=aturon 2017-11-29 18:37:47 +08:00
option.rs Slight modification to the as_ref example of std::option::Option 2018-02-24 11:37:38 -05:00
panic.rs Add missing micro version number component in stability attributes. 2018-01-24 22:25:42 +01:00
panicking.rs Bump master to 1.21.0 2017-07-25 07:03:19 -07:00
ptr.rs Correct a few stability attributes 2018-02-10 21:20:42 +00:00
raw.rs Fix up various links 2017-03-20 10:10:16 -04:00
result.rs Add transpose conversions for Option and Result 2018-01-10 17:42:47 -08:00
time.rs Correct a few stability attributes 2018-02-10 21:20:42 +00:00
tuple.rs Update bootstrap compiler 2017-08-31 06:58:58 -07:00
unit.rs impl FromIterator<()> for () 2017-10-18 23:12:37 -07:00