summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorBenjamin Hipple <bhipple@protonmail.com>2020-01-12 12:19:57 -0500
committerzimbatm <zimbatm@zimbatm.com>2020-01-12 17:19:57 +0000
commitc2e5ff3fe8e1e57cfbde9a098f55c8b8c2531b83 (patch)
treee0b26e23ec25fc863527da642602ca93e0364c69 /doc
parent6e8c3775628a4abcce07b5d195cf3f443ce9bbe8 (diff)
downloadnixpkgs-c2e5ff3fe8e1e57cfbde9a098f55c8b8c2531b83.tar
nixpkgs-c2e5ff3fe8e1e57cfbde9a098f55c8b8c2531b83.tar.gz
nixpkgs-c2e5ff3fe8e1e57cfbde9a098f55c8b8c2531b83.tar.bz2
nixpkgs-c2e5ff3fe8e1e57cfbde9a098f55c8b8c2531b83.tar.lz
nixpkgs-c2e5ff3fe8e1e57cfbde9a098f55c8b8c2531b83.tar.xz
nixpkgs-c2e5ff3fe8e1e57cfbde9a098f55c8b8c2531b83.tar.zst
nixpkgs-c2e5ff3fe8e1e57cfbde9a098f55c8b8c2531b83.zip
doc: update rust example on buildRustPackage (#77534)
The example in the manual was out of date and didn't use the newer `pname`
convention, which simplifies the fetch call.
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/rust.section.md18
1 files changed, 11 insertions, 7 deletions
diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md
index 709a0d504cf..0edf03ad26a 100644
--- a/doc/languages-frameworks/rust.section.md
+++ b/doc/languages-frameworks/rust.section.md
@@ -32,17 +32,17 @@ Rust applications are packaged by using the `buildRustPackage` helper from `rust
 
 ```
 rustPlatform.buildRustPackage rec {
-  name = "ripgrep-${version}";
-  version = "0.4.0";
+  pname = "ripgrep";
+  version = "11.0.2";
 
   src = fetchFromGitHub {
     owner = "BurntSushi";
-    repo = "ripgrep";
-    rev = "${version}";
-    sha256 = "0y5d1n6hkw85jb3rblcxqas2fp82h3nghssa4xqrhqnz25l799pj";
+    repo = pname;
+    rev = version;
+    sha256 = "1iga3320mgi7m853la55xip514a3chqsdi1a1rwv25lr9b1p7vd3";
   };
 
-  cargoSha256 = "0q68qyl2h6i0qsz82z840myxlnjay8p1w5z7hfyr8fqp7wgwa9cx";
+  cargoSha256 = "17ldqr3asrdcsh4l29m3b5r37r5d0b3npq1lrgjmxb6vlx6a36qh";
   verifyCargoDeps = true;
 
   meta = with stdenv.lib; {
@@ -66,7 +66,11 @@ added in `cargoPatches` will also be prepended to the patches in `patches` at
 build-time.
 
 When `verifyCargoDeps` is set to `true`, the build will also verify that the
-`cargoSha256` is not out of date by comparing the `Cargo.lock` file in both the `cargoDeps` and `src`. Note that this option changes the value of `cargoSha256` since it also copies the `Cargo.lock` in it. To avoid breaking backward-compatibility this option is not enabled by default but hopefully will be in the future.
+`cargoSha256` is not out of date by comparing the `Cargo.lock` file in both the
+`cargoDeps` and `src`. Note that this option changes the value of `cargoSha256`
+since it also copies the `Cargo.lock` in it. To avoid breaking
+backward-compatibility this option is not enabled by default but hopefully will
+be in the future.
 
 ### Building a crate for a different target