rust/src/libcore
Mark Rousskov c7a178ea5f
Rollup merge of #52658 - Wallacoloo:topics/use-option-methods, r=cramertj
Prefer `Option::map`/etc over `match` wherever it improves clarity

This isn't intended to change behavior anywhere. A lot of times statements like `match x { None => None, Some(y) => [...] }` can be rewritten using `Option::map` or `Option::and_then` in a way that preserves or improves clarity, so that's what I've done here.

I think it's particularly valuable to keep things in `libcore` and `libstd` pretty/idiomatic since it's not uncommon to follow the `[src]` links when browsing the rust-lang.org docs for std/core. If there's any concern about pushing style-based changes though, I'll happily back out the non-std/core commits here.
2018-07-24 16:43:49 -06:00
..
benches Move deny(warnings) into rustbuild 2018-04-08 16:59:14 -06:00
char migrate codebase to ..= inclusive range patterns 2018-06-26 07:53:30 -07:00
fmt migrate codebase to ..= inclusive range patterns 2018-06-26 07:53:30 -07:00
future Implement UnsafeFutureObj for &mut Future 2018-07-02 19:07:59 +02:00
hash impl PartialEq+Eq for BuildHasherDefault 2018-07-15 17:37:46 +02:00
iter Clarify short-circuiting behvaior of Iterator::zip. 2018-07-17 23:39:37 -04:00
num use proper footnote syntax for references 2018-07-11 13:26:56 -04:00
ops Changed implementation of the third field to make LLVM optimize it better. 2018-07-13 13:26:07 +08:00
prelude Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
slice fix safety-related comment in slice::rotate 2018-07-19 09:11:56 +02:00
str libcore: Prefer Option::map over match where applicable 2018-07-23 22:04:33 -07:00
sync Add #[repr(transparent)] to Atomic* types 2018-07-07 20:09:34 -07:00
task Forget Waker when cloning LocalWaker 2018-07-23 13:45:25 +02:00
tests Rollup merge of #52003 - Kerollmops:option-replace, r=Kimundi 2018-07-14 02:56:40 +08:00
unicode Handle array manually in string case conversion methods 2018-07-06 17:20:39 +02:00
alloc.rs Implement #[alloc_error_handler] 2018-07-09 23:13:24 +02:00
any.rs Any docs preposition change 2018-07-03 13:13:49 -07:00
array.rs Revert "Stabilize the TryFrom and TryInto traits" 2018-04-20 18:10:00 +02:00
ascii.rs migrate codebase to ..= inclusive range patterns 2018-06-26 07:53:30 -07:00
borrow.rs Fix formatting. 2018-03-18 13:05:00 +01:00
Cargo.toml Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
cell.rs use inherent method instead 2018-07-23 20:58:40 +08:00
clone.rs Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
cmp.rs Add message to rustc_on_unimplemented attributes in core 2018-06-19 15:19:13 -07:00
convert.rs AsRef doc wording tweaks 2018-07-15 10:16:36 +10:00
default.rs Fix "Quasi-quoting is inefficient" warning in incremental rustbuild. 2017-07-18 01:49:40 +08:00
hint.rs Stabilize core::hint::unreachable_unchecked. 2018-04-16 18:29:40 +08:00
internal_macros.rs Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
intrinsics.rs Add unaligned volatile intrinsics 2018-07-14 23:28:39 +01:00
iter_private.rs Various fixes to wording consistency in the docs 2017-03-22 17:19:52 +01:00
lib.rs Update stdsimd to undo an accidental stabilization 2018-07-20 22:34:09 -07:00
macros.rs Avoid using #[macro_export] for documenting builtin macros 2018-07-21 02:49:34 +03:00
marker.rs Fix doc link 2018-07-17 14:10:11 +02:00
mem.rs Don't use SIMD in mem::swap for types smaller than the block size 2018-07-21 21:43:37 -07:00
nonzero.rs Add #[repr(transparent)] to some libcore types 2018-06-16 18:25:15 +02:00
option.rs Rollup merge of #52218 - rivertam:patch-1, r=withoutboats 2018-07-18 22:34:56 +08:00
panic.rs Avoid unwrapping in PanicInfo doc example. 2018-07-10 22:25:38 -04:00
panicking.rs Bootstrap from 1.28.0-beta.3 2018-06-30 13:17:49 -07:00
ptr.rs Rollup merge of #52051 - scottmcm:swap-directly, r=alexcrichton 2018-07-23 01:02:41 +08:00
raw.rs Fix up various links 2017-03-20 10:10:16 -04:00
result.rs Add explanation for #[must_use] on Result 2018-05-07 10:26:28 -07:00
time.rs Make rounding down clear in duration documentation 2018-07-14 15:48:52 +02: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