Skip to content

Commit deb0fc6

Browse files
committed
Fix previous merge
1 parent 27c243a commit deb0fc6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,15 +518,16 @@ pub(crate) fn warn_host_version_mismatch(
518518
/// 1. Package metadata in the Cargo.toml
519519
/// 2. If the `CROSS_CONFIG` variable is set, it tries to read the config from its value
520520
/// 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;
522523
let cross_config_path = match env::var("CROSS_CONFIG") {
523524
Ok(var) => PathBuf::from(var),
524-
Err(_) => metadata.workspace_root.join("Cross.toml"),
525+
Err(_) => root.join("Cross.toml"),
525526
};
526527

527528
// Attempts to read the cross config from the Cargo.toml
528529
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")?;
530531
let cargo_cross_toml_opt = CrossToml::parse_from_cargo(&cargo_toml_str)?;
531532

532533
match (
@@ -554,7 +555,7 @@ fn toml(root: &Root) -> Result<Option<CrossToml>> {
554555
(false, Some(cfg)) => Ok(Some(cfg)),
555556
(false, None) => {
556557
// 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() {
558559
eprintln!("There's a file named cross.toml, instead of Cross.toml. You may want to rename it, or it won't be considered.");
559560
}
560561

0 commit comments

Comments
 (0)