@@ -3288,7 +3288,7 @@ pub mod gfx {
3288
3288
* Angolmois is not well refactored. (In fact, the game logic is usually hard to refactor, right?)
3289
3289
*/
3290
3290
pub mod player {
3291
- use std::{vec, cmp, num, iter, util };
3291
+ use std::{vec, cmp, num, iter};
3292
3292
use std::rc::Rc;
3293
3293
use sdl::*;
3294
3294
use sdl::video::*;
@@ -4091,6 +4091,8 @@ pub mod player {
4091
4091
4092
4092
/// Applies the blit command to given list of image resources. (C: a part of `load_resource`)
4093
4093
fn apply_blitcmd(imgres: &mut [ImageResource], bc: &BlitCmd) {
4094
+ use std::mem;
4095
+
4094
4096
let src = bc.src.to_uint();
4095
4097
let dst = bc.dst.to_uint();
4096
4098
if src == dst { return; }
@@ -4111,7 +4113,7 @@ pub mod player {
4111
4113
}
4112
4114
4113
4115
// temporarily swap imgres[src], otherwise it will cause an error
4114
- let savedorigin = util ::replace(&mut imgres[src], NoImage);
4116
+ let savedorigin = mem ::replace(&mut imgres[src], NoImage);
4115
4117
{
4116
4118
let origin = savedorigin.surface().unwrap();
4117
4119
let target = imgres[dst].surface().unwrap();
@@ -4302,12 +4304,11 @@ Artist: {artist}
4302
4304
/// (C: `resource_loaded`)
4303
4305
pub fn graphic_update_status(path: Option<~str>, screen: &Surface, saved_screen: &Surface,
4304
4306
font: &Font, ticker: &mut Ticker, atexit: ||) {
4305
- // Rust: `on_tick` calls the closure at most once so `path` won't be referenced twice,
4306
- // but the analysis can't reason that. (#4654) an " option dance" via
4307
- // `Option<T>::swap_unwrap` is not helpful here since `path` can be `None`.
4308
- let mut path = path; // XXX #4654
4307
+ use std::mem;
4308
+
4309
+ let mut path = path;
4309
4310
ticker.on_tick(get_ticks(), || {
4310
- let path = ::std::util:: replace(&mut path, None); // XXX #4654
4311
+ let path = mem:: replace(&mut path, None);
4311
4312
let msg = path.unwrap_or(~" loading...");
4312
4313
screen.blit_at(saved_screen, 0, (SCREENH-20) as i16);
4313
4314
screen.with_pixels(|pixels| {
@@ -4322,9 +4323,11 @@ Artist: {artist}
4322
4323
/// A callback template for `load_resource` with the textual loading screen.
4323
4324
/// (C: `resource_loaded`)
4324
4325
pub fn text_update_status(path: Option<~str>, ticker: &mut Ticker, atexit: ||) {
4325
- let mut path = path; // XXX #4654
4326
+ use std::mem;
4327
+
4328
+ let mut path = path;
4326
4329
ticker.on_tick(get_ticks(), || {
4327
- match ::std::util:: replace(&mut path, None) { // XXX #4654
4330
+ match mem:: replace(&mut path, None) {
4328
4331
Some(path) => {
4329
4332
use util::str::StrUtil;
4330
4333
let path = if path.len() < 63 {path} else {path.slice_upto(0, 63).to_owned()};
0 commit comments