From 50f57ac692c736b75ee7958c57b4111bf62fee9c Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 22 Aug 2022 14:29:50 -0700 Subject: [PATCH] doc/../rust.section.md: fix incorrect header depths The headings for the Rust section are structured incorrectly in two ways: 1. The section "Compiling non-Rust packages that include Rust code" is totally specific to `buildRustPackage`. It should be a child of the "Compiling Rust applications with Cargo" section. 1. The section "Setting up `nix-shell`" is totally specific to `buildRustCrate`. It should be a child of the "Compiling Rust crates using Nix instead of Cargo" section. - Rust - Compiling Rust applications with Cargo - ... - Compiling non-Rust packages that include Rust code - ... - Compiling Rust crates using Nix instead of Cargo - ... - Setting Up `nix-shell` - ... - Rust - Compiling Rust applications with Cargo - ... - Compiling non-Rust packages that include Rust code - ... - Compiling Rust crates using Nix instead of Cargo - ... - Setting Up `nix-shell` - ... --- doc/languages-frameworks/rust.section.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index 4f2ecc2cd4daf77..1073a97888ea046 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -411,13 +411,13 @@ rustPlatform.buildRustPackage rec { } ``` -## Compiling non-Rust packages that include Rust code {#compiling-non-rust-packages-that-include-rust-code} +### Compiling non-Rust packages that include Rust code {#compiling-non-rust-packages-that-include-rust-code} Several non-Rust packages incorporate Rust code for performance- or security-sensitive parts. `rustPlatform` exposes several functions and hooks that can be used to integrate Cargo in non-Rust packages. -### Vendoring of dependencies {#vendoring-of-dependencies} +#### Vendoring of dependencies {#vendoring-of-dependencies} Since network access is not allowed in sandboxed builds, Rust crate dependencies need to be retrieved using a fetcher. `rustPlatform` @@ -477,7 +477,7 @@ added. To find the correct hash, you can first use `lib.fakeSha256` or `lib.fakeHash` as a stub hash. Building `cargoDeps` will then inform you of the correct hash. -### Hooks {#hooks} +#### Hooks {#hooks} `rustPlatform` provides the following hooks to automate Cargo builds: @@ -513,7 +513,7 @@ you of the correct hash. * `bindgenHook`: for crates which use `bindgen` as a build dependency, lets `bindgen` find `libclang` and `libclang` find the libraries in `buildInputs`. -### Examples {#examples} +#### Examples {#examples} #### Python package using `setuptools-rust` {#python-package-using-setuptools-rust} @@ -863,7 +863,7 @@ features, we would write: Where `diesel.nix` is the file generated by Carnix, as explained above. -## Setting Up `nix-shell` {#setting-up-nix-shell} +### Setting Up `nix-shell` {#setting-up-nix-shell} Oftentimes you want to develop code from within `nix-shell`. Unfortunately `buildRustCrate` does not support common `nix-shell` operations directly