File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
//! Easy file downloading
2
2
3
3
use std:: fs:: remove_file;
4
- use std:: num:: NonZeroU64 ;
4
+ use std:: num:: NonZero ;
5
5
use std:: path:: Path ;
6
6
use std:: str:: FromStr ;
7
7
use std:: time:: Duration ;
@@ -201,9 +201,11 @@ async fn download_file_(
201
201
} ;
202
202
203
203
let timeout = Duration :: from_secs ( match process. var ( "RUSTUP_DOWNLOAD_TIMEOUT" ) {
204
- Ok ( s) => NonZeroU64 :: from_str ( & s) . context (
205
- "invalid value in RUSTUP_DOWNLOAD_TIMEOUT -- must be a natural number greater than zero" ,
206
- ) ?. get ( ) ,
204
+ Ok ( s) => NonZero :: from_str ( & s)
205
+ . context (
206
+ "invalid value in RUSTUP_DOWNLOAD_TIMEOUT -- must be a natural number greater than zero" ,
207
+ ) ?
208
+ . get ( ) ,
207
209
Err ( _) => 180 ,
208
210
} ) ;
209
211
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use std::ffi::OsString;
2
2
use std:: fmt:: Debug ;
3
3
use std:: io;
4
4
use std:: io:: IsTerminal ;
5
- use std:: num:: NonZeroU64 ;
5
+ use std:: num:: NonZero ;
6
6
use std:: path:: PathBuf ;
7
7
use std:: str:: FromStr ;
8
8
#[ cfg( feature = "test" ) ]
@@ -189,7 +189,7 @@ impl Process {
189
189
190
190
pub fn concurrent_downloads ( & self ) -> Option < usize > {
191
191
let s = self . var ( "RUSTUP_CONCURRENT_DOWNLOADS" ) . ok ( ) ?;
192
- Some ( NonZeroU64 :: from_str ( & s) . ok ( ) ?. get ( ) as usize )
192
+ Some ( NonZero :: from_str ( & s) . ok ( ) ?. get ( ) )
193
193
}
194
194
}
195
195
You can’t perform that action at this time.
0 commit comments