From 1bde6e3fcb32ca00cf8a8dfa0977e47f7f4a77bf Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Thu, 5 Jun 2014 23:18:51 -0700 Subject: Rename Iterator::len to count This commit carries out the request from issue #14678: > The method `Iterator::len()` is surprising, as all the other uses of > `len()` do not consume the value. `len()` would make more sense to be > called `count()`, but that would collide with the current > `Iterator::count(|T| -> bool) -> unit` method. That method, however, is > a bit redundant, and can be easily replaced with > `iter.filter(|x| x < 5).count()`. > After this change, we could then define the `len()` method > on `iter::ExactSize`. Closes #14678. [breaking-change] --- src/libstd/rt/backtrace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd/rt') diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs index ac421bf78be..fe6d84d4d2e 100644 --- a/src/libstd/rt/backtrace.rs +++ b/src/libstd/rt/backtrace.rs @@ -84,7 +84,7 @@ fn demangle(writer: &mut Writer, s: &str) -> IoResult<()> { if i == 0 { valid = chars.next().is_none(); break - } else if chars.by_ref().take(i - 1).len() != i - 1 { + } else if chars.by_ref().take(i - 1).count() != i - 1 { valid = false; } } -- cgit 1.4.1-3-g733a5 From 8bf6da0836be838f10e50de1105f92087f83f526 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 6 Jun 2014 20:17:19 -0700 Subject: Test fixes from the rollup --- src/librustdoc/clean/inline.rs | 2 +- src/libstd/rt/backtrace.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libstd/rt') diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index e9ea3a7b304..2a4774ffd84 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -88,7 +88,7 @@ fn try_inline_def(cx: &core::DocContext, record_extern_fqn(cx, did, clean::TypeModule); clean::ModuleItem(build_module(cx, tcx, did)) } - ast::DefStatic(did, mtbl) => { + def::DefStatic(did, mtbl) => { record_extern_fqn(cx, did, clean::TypeStatic); clean::StaticItem(build_static(tcx, did, mtbl)) } diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs index fe6d84d4d2e..94472ee7241 100644 --- a/src/libstd/rt/backtrace.rs +++ b/src/libstd/rt/backtrace.rs @@ -505,7 +505,6 @@ mod imp { use c_str::CString; use container::Container; use io::{IoResult, Writer}; - use iter::Iterator; use libc; use mem; use ops::Drop; -- cgit 1.4.1-3-g733a5