From ad7621d42ee90143cd15715cc546177575fd5844 Mon Sep 17 00:00:00 2001 From: Pazzaz Date: Fri, 6 Jul 2018 17:20:39 +0200 Subject: Handle array manually in string case conversion methods --- src/libcore/unicode/mod.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libcore') diff --git a/src/libcore/unicode/mod.rs b/src/libcore/unicode/mod.rs index b6b033adc04..e5cda880f88 100644 --- a/src/libcore/unicode/mod.rs +++ b/src/libcore/unicode/mod.rs @@ -20,6 +20,9 @@ pub(crate) mod version; pub mod derived_property { pub use unicode::tables::derived_property::{Case_Ignorable, Cased}; } +pub mod conversions { + pub use unicode::tables::conversions::{to_lower, to_upper}; +} // For use in libsyntax pub mod property { -- cgit 1.4.1-3-g733a5 From ede1a5d5edcebe28f98057d915ae4602378354dc Mon Sep 17 00:00:00 2001 From: Ben Berman Date: Tue, 10 Jul 2018 13:26:44 -0400 Subject: Amend option.take examples It wasn't abundantly clear to me what `.take` returned. Perhaps this is a slightly frivolous change, but I think it's an improvement. =) Apologies if I'm not following proper procedures. --- src/libcore/option.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 20bc173f7e1..c219a9fb521 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -833,12 +833,14 @@ impl Option { /// /// ``` /// let mut x = Some(2); - /// x.take(); + /// let y = x.take(); /// assert_eq!(x, None); + /// assert_eq!(y, Some(2)); /// /// let mut x: Option = None; - /// x.take(); + /// let y = x.take(); /// assert_eq!(x, None); + /// assert_eq!(y, None); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -- cgit 1.4.1-3-g733a5 From 2d4011db07f08d5c9f3bf9622955f54321877f7b Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Tue, 17 Jul 2018 23:39:37 -0400 Subject: Clarify short-circuiting behvaior of Iterator::zip. Fixes https://github.com/rust-lang/rust/issues/52279. --- src/libcore/iter/iterator.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libcore') diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index c0681619bf8..afc273d265b 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -384,7 +384,9 @@ pub trait Iterator { /// /// In other words, it zips two iterators together, into a single one. /// - /// If either iterator returns [`None`], [`next`] will return [`None`]. + /// If either iterator returns [`None`], [`next`] from the zipped iterator + /// will return [`None`]. If the first iterator returns [`None`], `zip` will + /// short-circuit and `next` will not be called on the second iterator. /// /// # Examples /// -- cgit 1.4.1-3-g733a5