@@ -76,7 +76,6 @@ use crate::sources::CRATES_IO_REGISTRY;
76
76
use crate :: util:: errors:: CargoResult ;
77
77
use crate :: util:: network:: http:: configure_http_handle;
78
78
use crate :: util:: network:: http:: http_handle;
79
- use crate :: util:: toml as cargo_toml;
80
79
use crate :: util:: { internal, CanonicalUrl } ;
81
80
use crate :: util:: { try_canonicalize, validate_package_name} ;
82
81
use crate :: util:: { Filesystem , IntoUrl , IntoUrlWithBase , Rustc } ;
@@ -1198,7 +1197,7 @@ impl Config {
1198
1197
}
1199
1198
let contents = fs:: read_to_string ( path)
1200
1199
. with_context ( || format ! ( "failed to read configuration file `{}`" , path. display( ) ) ) ?;
1201
- let toml = cargo_toml :: parse_document ( & contents, path, self ) . with_context ( || {
1200
+ let toml = parse_document ( & contents, path, self ) . with_context ( || {
1202
1201
format ! ( "could not parse TOML configuration in `{}`" , path. display( ) )
1203
1202
} ) ?;
1204
1203
let def = match why_load {
@@ -2249,7 +2248,7 @@ pub fn save_credentials(
2249
2248
)
2250
2249
} ) ?;
2251
2250
2252
- let mut toml = cargo_toml :: parse_document ( & contents, file. path ( ) , cfg) ?;
2251
+ let mut toml = parse_document ( & contents, file. path ( ) , cfg) ?;
2253
2252
2254
2253
// Move the old token location to the new one.
2255
2254
if let Some ( token) = toml. remove ( "token" ) {
@@ -2716,6 +2715,11 @@ impl EnvConfigValue {
2716
2715
2717
2716
pub type EnvConfig = HashMap < String , EnvConfigValue > ;
2718
2717
2718
+ fn parse_document ( toml : & str , _file : & Path , _config : & Config ) -> CargoResult < toml:: Table > {
2719
+ // At the moment, no compatibility checks are needed.
2720
+ toml. parse ( ) . map_err ( Into :: into)
2721
+ }
2722
+
2719
2723
/// A type to deserialize a list of strings from a toml file.
2720
2724
///
2721
2725
/// Supports deserializing either a whitespace-separated list of arguments in a
0 commit comments