From 7ba762253ccf487ae61b2be45a9edfdf19b79cc0 Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Sat, 3 Dec 2016 21:59:00 +0100 Subject: [PATCH] std: Forward ExactSizeIterator::is_empty for Args, ArgsOs iterators --- src/libstd/env.rs | 2 ++ src/libstd/lib.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/libstd/env.rs b/src/libstd/env.rs index baa2b5d28462..ee6a907f6160 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -630,6 +630,7 @@ impl Iterator for Args { #[stable(feature = "env", since = "1.0.0")] impl ExactSizeIterator for Args { fn len(&self) -> usize { self.inner.len() } + fn is_empty(&self) -> bool { self.inner.is_empty() } } #[stable(feature = "env_iterators", since = "1.11.0")] @@ -649,6 +650,7 @@ impl Iterator for ArgsOs { #[stable(feature = "env", since = "1.0.0")] impl ExactSizeIterator for ArgsOs { fn len(&self) -> usize { self.inner.len() } + fn is_empty(&self) -> bool { self.inner.is_empty() } } #[stable(feature = "env_iterators", since = "1.11.0")] diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 8132b1392602..1f40d3fd1d35 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -250,6 +250,7 @@ #![feature(core_float)] #![feature(core_intrinsics)] #![feature(dropck_parametricity)] +#![feature(exact_size_is_empty)] #![feature(float_extras)] #![feature(float_from_str_radix)] #![feature(fn_traits)]