Skip to content

Commit

Permalink
feat(rust/cargo-lock): remove binary not found warning as it is too n…
Browse files Browse the repository at this point in the history
…oisy
  • Loading branch information
yusdacra committed Feb 16, 2022
1 parent 27b4b5c commit 3a3cfd7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/translators/rust/pure/cargo-lock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@
|| l.pathExists "${l.dirOf toml.path}/src/bin";

# Try to find a package with a binary
pkg =
l.findFirst
hasBinaries
(l.warn "couldn't find a package with a binary to use as mainPackage" (l.elemAt cargoPackages 0))
cargoPackages;
pkg = l.findFirst hasBinaries (l.elemAt cargoPackages 0) cargoPackages;

in pkg.value.package.name
else args.packageName;

# Find the Cargo.toml matching the package name
checkForPackageName = cargoToml: (cargoToml.value.package.name or null) == packageName;
packageToml = l.findFirst checkForPackageName (throw "no Cargo.toml found with the package name passed: ${packageName}") cargoTomls;
packageToml =
l.findFirst
checkForPackageName
(throw "no Cargo.toml found with the package name passed: ${packageName}")
cargoTomls;

# Parse Cargo.lock and extract dependencies
parsedLock = l.fromTOML (l.readFile "${inputDir}/Cargo.lock");
Expand Down

0 comments on commit 3a3cfd7

Please sign in to comment.