@@ -190,8 +190,7 @@ impl Config {
190
190
let mut file = File :: open ( & file_path) ?;
191
191
let mut toml = String :: new ( ) ;
192
192
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) )
195
194
}
196
195
197
196
/// Resolves the config for input in `dir`.
@@ -253,7 +252,7 @@ impl Config {
253
252
}
254
253
}
255
254
256
- pub ( crate ) fn from_toml ( toml : & str , dir : & Path ) -> Result < Config , String > {
255
+ pub ( crate ) fn from_toml ( toml : & str ) -> Result < Config , String > {
257
256
let parsed: :: toml:: Value = toml
258
257
. parse ( )
259
258
. map_err ( |e| format ! ( "Could not parse TOML: {}" , e) ) ?;
@@ -272,7 +271,7 @@ impl Config {
272
271
if !err. is_empty ( ) {
273
272
eprint ! ( "{}" , err) ;
274
273
}
275
- Ok ( Config :: default ( ) . fill_from_parsed_config ( parsed_config, dir ) )
274
+ Ok ( Config :: default ( ) . fill_from_parsed_config ( parsed_config) )
276
275
}
277
276
Err ( e) => {
278
277
err. push_str ( "Error: Decoding config file failed:\n " ) ;
@@ -426,8 +425,7 @@ mod test {
426
425
427
426
#[ test]
428
427
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 ( ) ;
431
429
432
430
assert_eq ! ( config. was_set( ) . hard_tabs( ) , true ) ;
433
431
assert_eq ! ( config. was_set( ) . verbose( ) , false ) ;
0 commit comments