diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 2cfd8d17286..e4772592e46 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -59,8 +59,8 @@ assert buildType == "release" || buildType == "debug"; let cargoDeps = - if cargoVendorDir == null - then if cargoLock != null then importCargoLock cargoLock + if cargoVendorDir != null then null + else if cargoLock != null then importCargoLock cargoLock else fetchCargoTarball ({ inherit src srcs sourceRoot unpackPhase cargoUpdateHook; name = cargoDepsName; @@ -69,8 +69,7 @@ let hash = args.cargoHash; } // lib.optionalAttrs (args ? cargoSha256) { sha256 = args.cargoSha256; - } // depsExtraArgs) - else null; + } // depsExtraArgs); # If we have a cargoSha256 fixed-output derivation, validate it at build time # against the src fixed-output derivation to check consistency.