diff options
| author | blake2-ppc <blake2-ppc> | 2013-09-10 03:55:34 +0200 |
|---|---|---|
| committer | blake2-ppc <blake2-ppc> | 2013-09-10 05:50:07 +0200 |
| commit | 5f69a58e0ccf3d85b5f12f26ecf78ee7e7fec270 (patch) | |
| tree | 5570e79d2109ad1afe6fc5040c91045e57c79645 /src | |
| parent | 77dff93a4baa4164311e14763cfcbb05e410359b (diff) | |
| download | rust-5f69a58e0ccf3d85b5f12f26ecf78ee7e7fec270.tar.gz rust-5f69a58e0ccf3d85b5f12f26ecf78ee7e7fec270.zip | |
std::vec: Remove the function same_length
The basic construct x.len() == y.len() is just as simple. This function used to be a precondition (not sure about the terminology), so it had to be a function. This is not relevant any more.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/middle/typeck/infer/combine.rs | 4 | ||||
| -rw-r--r-- | src/libstd/vec.rs | 5 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/librustc/middle/typeck/infer/combine.rs b/src/librustc/middle/typeck/infer/combine.rs index b04719ee3ce..693aee83061 100644 --- a/src/librustc/middle/typeck/infer/combine.rs +++ b/src/librustc/middle/typeck/infer/combine.rs @@ -88,7 +88,7 @@ pub trait Combine { // future we could allow type parameters to declare a // variance. - if vec::same_length(as_, bs) { + if as_.len() == bs.len() { result::fold_(as_.iter().zip(bs.iter()) .map(|(a, b)| eq_tys(self, *a, *b))) .then(|| Ok(as_.to_owned())) @@ -419,7 +419,7 @@ pub fn super_fn_sigs<C:Combine>( this: &C, a: &ty::FnSig, b: &ty::FnSig) -> cres<ty::FnSig> { fn argvecs<C:Combine>(this: &C, a_args: &[ty::t], b_args: &[ty::t]) -> cres<~[ty::t]> { - if vec::same_length(a_args, b_args) { + if a_args.len() == b_args.len() { result::collect(a_args.iter().zip(b_args.iter()) .map(|(a, b)| this.args(*a, *b))) } else { diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index b55a236566b..27566bf23c8 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -123,11 +123,6 @@ use unstable::raw::{Box, Repr, Slice, Vec}; use vec; use util; -/// Returns true if two vectors have the same length -pub fn same_length<T, U>(xs: &[T], ys: &[U]) -> bool { - xs.len() == ys.len() -} - /** * Creates and initializes an owned vector. * |
