@@ -17,7 +17,7 @@ pub(crate) fn read_config(manifest_path: PathBuf) -> Result<Config, ErrorString>
17
17
}
18
18
19
19
pub ( crate ) fn read_config_inner ( manifest_path : PathBuf ) -> Result < Config , ErrorString > {
20
- use std:: { convert :: TryFrom , fs:: File , io:: Read } ;
20
+ use std:: { fs:: File , io:: Read } ;
21
21
let cargo_toml: Value = {
22
22
let mut content = String :: new ( ) ;
23
23
File :: open ( & manifest_path)
@@ -54,10 +54,11 @@ pub(crate) fn read_config_inner(manifest_path: PathBuf) -> Result<Config, ErrorS
54
54
for ( key, value) in metadata {
55
55
match ( key. as_str ( ) , value. clone ( ) ) {
56
56
( "default-target" , Value :: String ( s) ) => config. default_target = From :: from ( s) ,
57
- ( "test-timeout" , Value :: Integer ( s) ) => {
58
- config. test_timeout = u64:: try_from ( s)
59
- . map_err ( |err| format ! ( "test-timeout is not valid: {}" , err) ) ?
60
- . into ( )
57
+ ( "test-timeout" , Value :: Integer ( timeout) ) if timeout. is_negative ( ) => {
58
+ Err ( format ! ( "test-timeout must not be negative" ) ) ?
59
+ }
60
+ ( "test-timeout" , Value :: Integer ( timeout) ) => {
61
+ config. test_timeout = Some ( timeout as u64 ) ;
61
62
}
62
63
( "run-command" , Value :: Array ( array) ) => {
63
64
let mut command = Vec :: new ( ) ;
0 commit comments