1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2025,2026 ndaal Gesellschaft für Sicherheit in der Informationstechnik mbH & Co KG, Cologne
# rustfmt.toml — ndaal linting configuration
# Files and directories excluded from linting
# Reference: https://rust-lang.github.io/rustfmt/
# ---------------------------------------------------------------------------
# Rust edition — must match Cargo.toml [package] edition
# ---------------------------------------------------------------------------
= "2021"
# ---------------------------------------------------------------------------
# Line length
# ---------------------------------------------------------------------------
= 100 # hard ceiling; rustfmt wraps/breaks at this width
= 80 # soft limit for comment reflow
= true # reflow overlong doc/inline comments
# ---------------------------------------------------------------------------
# Imports — deterministic, grouped, sorted
# ---------------------------------------------------------------------------
= "Module" # merge imports at the module level
= "StdExternalCrate" # std → external → crate
= true
= true
# ---------------------------------------------------------------------------
# Braces & blocks
# ---------------------------------------------------------------------------
= "SameLineWhere" # K&R style
= "AlwaysSameLine"
= "Vertical" # trailing comma in multi-line contexts
= true
# ---------------------------------------------------------------------------
# Functions & closures
# ---------------------------------------------------------------------------
= "Tall" # one arg per line when it doesn't fit
= false # never collapse a fn body to one line
= true # always write extern "C" not extern
# ---------------------------------------------------------------------------
# Strings & literals
# ---------------------------------------------------------------------------
= false # do not reformat string contents
= true
# ---------------------------------------------------------------------------
# Types
# ---------------------------------------------------------------------------
= true # struct Foo { x } instead of Foo { x: x }
= true # ? instead of try!()
= true # /// over #[doc = "..."]
# ---------------------------------------------------------------------------
# Security / hygiene
# ---------------------------------------------------------------------------
= true
= true # collapse consecutive #[derive(...)]