Skip to content

Commit 47df177

Browse files
committed
Fix deprecation warnings for sleep_ms
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.
1 parent 8281ae8 commit 47df177

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

rust-install/src/utils/raw.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::process::{Command, Stdio, ExitStatus};
88
use std::ffi::{OsStr, OsString};
99
use std::fmt;
1010
use std::thread;
11+
use std::time::Duration;
1112
use hyper::{self, Client};
1213
use openssl::crypto::hash::Hasher;
1314

@@ -268,7 +269,7 @@ pub fn remove_dir(path: &Path) -> io::Result<()> {
268269
if !is_directory(path) {
269270
return Ok(());
270271
}
271-
thread::sleep_ms(100);
272+
thread::sleep(Duration::from_millis(100));
272273
}
273274
result
274275
}

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use std::ffi::OsStr;
2929
use std::fmt;
3030
use std::iter;
3131
use std::thread;
32+
use std::time::Duration;
3233
use multirust::*;
3334
use rust_install::dist;
3435
use openssl::crypto::hash::{Type, Hasher};
@@ -338,7 +339,7 @@ fn handle_install(cfg: &Cfg, should_move: bool, add_to_path: bool) -> Result<()>
338339
if should_move {
339340
if cfg!(windows) {
340341
// Wait for old version to exit
341-
thread::sleep_ms(1000);
342+
thread::sleep(Duration::from_millis(1000));
342343
}
343344
try!(utils::rename_file("multirust", &src_path, &dest_path));
344345
} else {

0 commit comments

Comments
 (0)