···461461 the `Cargo.lock`/`Cargo.toml` files need to be patched before
462462 vendoring.
463463464464-In case the lockfile contains cargo `git` dependencies, you can use
465465-`fetchCargoVendor` instead.
466466-```nix
467467-{
468468- cargoDeps = rustPlatform.fetchCargoVendor {
469469- inherit src;
470470- hash = "sha256-RqPVFovDaD2rW31HyETJfQ0qVwFxoGEvqkIgag3H6KU=";
471471- };
472472-}
473473-```
474474-475464If a `Cargo.lock` file is available, you can alternatively use the
476465`importCargoLock` function. In contrast to `fetchCargoVendor`, this
477466function does not require a hash (unless git dependencies are used)
+2-2
lib/attrsets.nix
···1717 /**
1818 Return an attribute from nested attribute sets.
19192020- Nix has an [attribute selection operator `. or`](https://nixos.org/manual/nix/stable/language/operators#attribute-selection) which is sufficient for such queries, as long as the number of attributes is static. For example:
2020+ Nix has an [attribute selection operator `.`](https://nixos.org/manual/nix/stable/language/operators#attribute-selection) which is sufficient for such queries, as long as the number of attributes is static. For example:
21212222 ```nix
2323 (x.a.b or 6) == attrByPath ["a" "b"] 6 x
···319319 getAttrFromPath =
320320 attrPath:
321321 set:
322322- attrByPath attrPath (abort ("cannot find attribute `" + concatStringsSep "." attrPath + "'")) set;
322322+ attrByPath attrPath (abort ("cannot find attribute '" + concatStringsSep "." attrPath + "'")) set;
323323324324 /**
325325 Map each attribute in the given set and merge them into a new attribute set.