diff options
author | Adam Joseph <adam@westernsemico.com> | 2022-08-22 14:29:50 -0700 |
---|---|---|
committer | Adam Joseph <adam@westernsemico.com> | 2023-03-15 19:42:54 -0700 |
commit | 50f57ac692c736b75ee7958c57b4111bf62fee9c (patch) | |
tree | a5cdbf6e60e34a3654a21c02d4b499fdc9ad2cf8 /doc | |
parent | efbbdc16e6defc1ac5243697bf9671fbe0720f80 (diff) |
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` - ...
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/rust.section.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index 4f2ecc2cd4daf..1073a97888ea0 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 |