Skip to content

Commit

Permalink
doc/../rust.section.md: fix incorrect header depths
Browse files Browse the repository at this point in the history
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`
      - ...
  • Loading branch information
Adam Joseph committed Mar 16, 2023
1 parent efbbdc1 commit 50f57ac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/languages-frameworks/rust.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 50f57ac

Please sign in to comment.