Skip to content

Commit

Permalink
Fix deprecation warnings for sleep_ms
Browse files Browse the repository at this point in the history
std::thread::sleep_ms has been deprecated in favor of std::thread::sleep
with a std::time::Duration being passed as the argument. This updates
all usage in this project of sleep_ms with sleep.
  • Loading branch information
jwilm committed Dec 17, 2015
1 parent 8281ae8 commit 47df177
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion rust-install/src/utils/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::process::{Command, Stdio, ExitStatus};
use std::ffi::{OsStr, OsString};
use std::fmt;
use std::thread;
use std::time::Duration;
use hyper::{self, Client};
use openssl::crypto::hash::Hasher;

Expand Down Expand Up @@ -268,7 +269,7 @@ pub fn remove_dir(path: &Path) -> io::Result<()> {
if !is_directory(path) {
return Ok(());
}
thread::sleep_ms(100);
thread::sleep(Duration::from_millis(100));
}
result
}
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use std::ffi::OsStr;
use std::fmt;
use std::iter;
use std::thread;
use std::time::Duration;
use multirust::*;
use rust_install::dist;
use openssl::crypto::hash::{Type, Hasher};
Expand Down Expand Up @@ -338,7 +339,7 @@ fn handle_install(cfg: &Cfg, should_move: bool, add_to_path: bool) -> Result<()>
if should_move {
if cfg!(windows) {
// Wait for old version to exit
thread::sleep_ms(1000);
thread::sleep(Duration::from_millis(1000));
}
try!(utils::rename_file("multirust", &src_path, &dest_path));
} else {
Expand Down

0 comments on commit 47df177

Please sign in to comment.