about summary refs log tree commit diff
path: root/src/libnum
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-03-30 23:53:26 -0400
committerDaniel Micay <danielmicay@gmail.com>2014-03-31 01:13:48 -0400
commitcbbc1fc843a0bea0191f66b76ff6fcc9005d7b0f (patch)
tree8ae67254c54ac66f5f74a1418e67326b39458d56 /src/libnum
parent612e22e417b41326b2060416892c7b16d921e20b (diff)
downloadrust-cbbc1fc843a0bea0191f66b76ff6fcc9005d7b0f.tar.gz
rust-cbbc1fc843a0bea0191f66b76ff6fcc9005d7b0f.zip
vec: convert `append` and `append_one` to methods
These were only free functions on `~[T]` because taking self by-value
used to be broken.
Diffstat (limited to 'src/libnum')
-rw-r--r--src/libnum/bigint.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libnum/bigint.rs b/src/libnum/bigint.rs
index 86db7cbb625..11d28398bea 100644
--- a/src/libnum/bigint.rs
+++ b/src/libnum/bigint.rs
@@ -28,7 +28,6 @@ use rand::Rng;
 use std::str;
 use std::uint;
 use std::{i64, u64};
-use std::vec;
 
 /**
 A `BigDigit` is a `BigUint`'s composing element.
@@ -747,8 +746,7 @@ impl BigUint {
     fn shl_unit(&self, n_unit: uint) -> BigUint {
         if n_unit == 0 || self.is_zero() { return (*self).clone(); }
 
-        return BigUint::new(vec::append(Vec::from_elem(n_unit, ZERO_BIG_DIGIT),
-                                           self.data.as_slice()));
+        BigUint::new(Vec::from_elem(n_unit, ZERO_BIG_DIGIT).append(self.data.as_slice()))
     }
 
     #[inline]