@@ -518,15 +518,16 @@ pub(crate) fn warn_host_version_mismatch(
518
518
/// 1. Package metadata in the Cargo.toml
519
519
/// 2. If the `CROSS_CONFIG` variable is set, it tries to read the config from its value
520
520
/// 3. Otherwise, the `Cross.toml` in the project root is set.
521
- fn toml ( root : & Root ) -> Result < Option < CrossToml > > {
521
+ fn toml ( metadata : & CargoMetadata ) -> Result < Option < CrossToml > > {
522
+ let root = & metadata. workspace_root ;
522
523
let cross_config_path = match env:: var ( "CROSS_CONFIG" ) {
523
524
Ok ( var) => PathBuf :: from ( var) ,
524
- Err ( _) => metadata . workspace_root . join ( "Cross.toml" ) ,
525
+ Err ( _) => root . join ( "Cross.toml" ) ,
525
526
} ;
526
527
527
528
// Attempts to read the cross config from the Cargo.toml
528
529
let cargo_toml_str =
529
- file:: read ( root. path ( ) . join ( "Cargo.toml" ) ) . wrap_err ( "failed to read Cargo.toml" ) ?;
530
+ file:: read ( root. join ( "Cargo.toml" ) ) . wrap_err ( "failed to read Cargo.toml" ) ?;
530
531
let cargo_cross_toml_opt = CrossToml :: parse_from_cargo ( & cargo_toml_str) ?;
531
532
532
533
match (
@@ -554,7 +555,7 @@ fn toml(root: &Root) -> Result<Option<CrossToml>> {
554
555
( false , Some ( cfg) ) => Ok ( Some ( cfg) ) ,
555
556
( false , None ) => {
556
557
// Checks if there is a lowercase version of this file
557
- if root. path ( ) . join ( "cross.toml" ) . exists ( ) {
558
+ if root. join ( "cross.toml" ) . exists ( ) {
558
559
eprintln ! ( "There's a file named cross.toml, instead of Cross.toml. You may want to rename it, or it won't be considered." ) ;
559
560
}
560
561
0 commit comments