Skip to content

Commit e9018f9

Browse files
committed
auto merge of #14295 : aturon/rust/hide-init_to_vec, r=alexcrichton
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]
2 parents 1ba7bd1 + a211907 commit e9018f9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/libcollections/bitv.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -486,17 +486,13 @@ impl Bitv {
486486
!self.none()
487487
}
488488

489-
pub fn init_to_vec(&self, i: uint) -> uint {
490-
return if self.get(i) { 1 } else { 0 };
491-
}
492-
493489
/**
494490
* Converts `self` to a vector of `uint` with the same length.
495491
*
496492
* Each `uint` in the resulting vector has either value `0u` or `1u`.
497493
*/
498494
pub fn to_vec(&self) -> Vec<uint> {
499-
Vec::from_fn(self.nbits, |x| self.init_to_vec(x))
495+
Vec::from_fn(self.nbits, |i| if self.get(i) { 1 } else { 0 })
500496
}
501497

502498
/**

0 commit comments

Comments
 (0)