diff options
| author | Luqman Aden <laden@csclub.uwaterloo.ca> | 2013-02-15 03:51:28 -0500 |
|---|---|---|
| committer | Luqman Aden <laden@mozilla.com> | 2013-02-15 02:49:54 -0800 |
| commit | 5912b1448ca1b5bcddf8af1ed9e16fc41775af9c (patch) | |
| tree | a4f7a4cc64b3afd75688bc530bb161210eacf1e7 /src/libcore/util.rs | |
| parent | 78f3e0da700ef88ce9b46078292295e51355a756 (diff) | |
| download | rust-5912b1448ca1b5bcddf8af1ed9e16fc41775af9c.tar.gz rust-5912b1448ca1b5bcddf8af1ed9e16fc41775af9c.zip | |
libcore: Get rid of `move`.
Diffstat (limited to 'src/libcore/util.rs')
| -rw-r--r-- | src/libcore/util.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libcore/util.rs b/src/libcore/util.rs index 87cbcdfe30b..eea172a43ce 100644 --- a/src/libcore/util.rs +++ b/src/libcore/util.rs @@ -19,7 +19,7 @@ use prelude::*; /// The identity function. #[inline(always)] -pub pure fn id<T>(x: T) -> T { move x } +pub pure fn id<T>(x: T) -> T { x } /// Ignores a value. #[inline(always)] @@ -37,10 +37,10 @@ pub fn with<T: Copy, R>( // we wouldn't need to copy... let old_value = *ptr; - *ptr = move new_value; + *ptr = new_value; let result = op(); - *ptr = move old_value; - return move result; + *ptr = old_value; + return result; } /** @@ -58,9 +58,9 @@ pub fn swap<T>(x: &mut T, y: &mut T) { */ #[inline(always)] pub fn replace<T>(dest: &mut T, src: T) -> T { - let mut tmp = move src; + let mut tmp = src; swap(dest, &mut tmp); - move tmp + tmp } /// A non-copyable dummy type. @@ -109,7 +109,7 @@ mod tests { let x = ~[(5, false)]; //FIXME #3387 assert x.eq(id(copy x)); let y = copy x; - assert x.eq(&id(move y)); + assert x.eq(&id(y)); } #[test] pub fn test_swap() { |
