about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-05-19 11:46:29 -0700
committerAaron Turon <aturon@mozilla.com>2014-05-19 13:50:03 -0700
commita211907f88a8ac7a7deb3bd4c028e5dd34be95a2 (patch)
tree9aa654736c7ee520c7b345dd0f03e04ef6af0dc1
parent42be687fa1a1070195c25a8e607d1209a9f8c88b (diff)
downloadrust-a211907f88a8ac7a7deb3bd4c028e5dd34be95a2.tar.gz
rust-a211907f88a8ac7a7deb3bd4c028e5dd34be95a2.zip
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]
-rw-r--r--src/libcollections/bitv.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libcollections/bitv.rs b/src/libcollections/bitv.rs
index 871584b669e..e2934efa43b 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<uint> {
-        Vec::from_fn(self.nbits, |x| self.init_to_vec(x))
+        Vec::from_fn(self.nbits, |i| if self.get(i) { 1 } else { 0 })
     }
 
     /**