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 11//! Easy file downloading
22
33use std:: fs:: remove_file;
4- use std:: num:: NonZeroU64 ;
4+ use std:: num:: NonZero ;
55use std:: path:: Path ;
66use std:: str:: FromStr ;
77use std:: time:: Duration ;
@@ -201,9 +201,11 @@ async fn download_file_(
201201 } ;
202202
203203 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 ( ) ,
207209 Err ( _) => 180 ,
208210 } ) ;
209211
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use std::ffi::OsString;
22use std:: fmt:: Debug ;
33use std:: io;
44use std:: io:: IsTerminal ;
5- use std:: num:: NonZeroU64 ;
5+ use std:: num:: NonZero ;
66use std:: path:: PathBuf ;
77use std:: str:: FromStr ;
88#[ cfg( feature = "test" ) ]
@@ -189,7 +189,7 @@ impl Process {
189189
190190 pub fn concurrent_downloads ( & self ) -> Option < usize > {
191191 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 ( ) )
193193 }
194194}
195195
You can’t perform that action at this time.
0 commit comments