@@ -190,8 +190,7 @@ impl Config {
190190 let mut file = File :: open ( & file_path) ?;
191191 let mut toml = String :: new ( ) ;
192192 file. read_to_string ( & mut toml) ?;
193- Config :: from_toml ( & toml, file_path. parent ( ) . unwrap ( ) )
194- . map_err ( |err| Error :: new ( ErrorKind :: InvalidData , err) )
193+ Config :: from_toml ( & toml) . map_err ( |err| Error :: new ( ErrorKind :: InvalidData , err) )
195194 }
196195
197196 /// Resolves the config for input in `dir`.
@@ -253,7 +252,7 @@ impl Config {
253252 }
254253 }
255254
256- pub ( crate ) fn from_toml ( toml : & str , dir : & Path ) -> Result < Config , String > {
255+ pub ( crate ) fn from_toml ( toml : & str ) -> Result < Config , String > {
257256 let parsed: :: toml:: Value = toml
258257 . parse ( )
259258 . map_err ( |e| format ! ( "Could not parse TOML: {}" , e) ) ?;
@@ -272,7 +271,7 @@ impl Config {
272271 if !err. is_empty ( ) {
273272 eprint ! ( "{}" , err) ;
274273 }
275- Ok ( Config :: default ( ) . fill_from_parsed_config ( parsed_config, dir ) )
274+ Ok ( Config :: default ( ) . fill_from_parsed_config ( parsed_config) )
276275 }
277276 Err ( e) => {
278277 err. push_str ( "Error: Decoding config file failed:\n " ) ;
@@ -426,8 +425,7 @@ mod test {
426425
427426 #[ test]
428427 fn test_was_set ( ) {
429- use std:: path:: Path ;
430- let config = Config :: from_toml ( "hard_tabs = true" , Path :: new ( "" ) ) . unwrap ( ) ;
428+ let config = Config :: from_toml ( "hard_tabs = true" ) . unwrap ( ) ;
431429
432430 assert_eq ! ( config. was_set( ) . hard_tabs( ) , true ) ;
433431 assert_eq ! ( config. was_set( ) . verbose( ) , false ) ;
0 commit comments