libcore: fix move semantics fallout

This commit is contained in:
Jorge Aparicio 2014-12-01 15:52:17 -05:00
parent c73259a269
commit 65d3a40c07
2 changed files with 3 additions and 3 deletions

View File

@ -2166,7 +2166,7 @@ impl<A: Add<A, A> + Clone> Iterator<A> for Counter<A> {
#[inline]
fn next(&mut self) -> Option<A> {
let result = self.state.clone();
self.state = self.state + self.step;
self.state = self.state.clone() + self.step.clone();
Some(result)
}

View File

@ -37,8 +37,8 @@ use str::{FromStr, from_str, StrPrelude};
/// Simultaneous division and remainder
#[inline]
#[deprecated = "use division and remainder directly"]
pub fn div_rem<T: Div<T, T> + Rem<T, T>>(x: T, y: T) -> (T, T) {
(x / y, x % y)
pub fn div_rem<T: Clone + Div<T, T> + Rem<T, T>>(x: T, y: T) -> (T, T) {
(x.clone() / y.clone(), x % y)
}
/// Raises a `base` to the power of `exp`, using exponentiation by squaring.