From a211907f88a8ac7a7deb3bd4c028e5dd34be95a2 Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Mon, 19 May 2014 11:46:29 -0700 Subject: [PATCH] libcollections: remove `init_to_vec` The `init_to_vec` function in `collections::bitv` was exposed as an inherent method, but appears to just be a helper function for the `to_vec` method. This patch inlines the definition, removing `init_to_vec` from the public API. [breaking-change] --- src/libcollections/bitv.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libcollections/bitv.rs b/src/libcollections/bitv.rs index 871584b669e75..e2934efa43b65 100644 --- a/src/libcollections/bitv.rs +++ b/src/libcollections/bitv.rs @@ -486,17 +486,13 @@ impl Bitv { !self.none() } - pub fn init_to_vec(&self, i: uint) -> uint { - return if self.get(i) { 1 } else { 0 }; - } - /** * Converts `self` to a vector of `uint` with the same length. * * Each `uint` in the resulting vector has either value `0u` or `1u`. */ pub fn to_vec(&self) -> Vec { - Vec::from_fn(self.nbits, |x| self.init_to_vec(x)) + Vec::from_fn(self.nbits, |i| if self.get(i) { 1 } else { 0 }) } /**