libcore: fix move semantics fallout
This commit is contained in:
parent
c73259a269
commit
65d3a40c07
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user