Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
1329 lines (962 loc) · 47.9 KB
/
Copy pathCargo.toml
File metadata and controls
1329 lines (962 loc) · 47.9 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# TODO Reviewed ??-??-2026.
[package]
name = "mdbook-utils"
version = "0.1.4"
description = "Tools to manage links, reference definitions, and code examples in Markdown files, especially `mdbook` source directories."
authors = ["John CD"]
edition = "2024"
rust-version = "1.99"
license-file = "LICENSE"
readme = "README.md"
homepage = "https://john-cd.com/mdbook-utils/"
repository = "https://github.com/john-cd/mdbook-utils/"
publish = false
keywords = ["documentation", "markdown", "book", "mdbook", "rustbook"]
categories = [
"parser-implementations",
"parsing",
"text-processing",
"development-tools",
"command-line-utilities",
]
[package.metadata.binstall]
# Archives built by .github/workflows/release.yml:
# mdbook-utils-<target>-v<version>.tar.gz (.zip on Windows), binary at the root.
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }"
bin-dir = "{ bin }{ binary-ext }"
pkg-fmt = "tgz"
[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"
exclude = [
"/.devcontainer",
"/.github",
"/test_book",
"/user_guide",
".*",
"TODO.md",
"rustfmt.toml",
"justfile",
"CONTRIBUTING.md",
"CODE_OF_CONDUCT.md",
"RELEASES.md",
"rustfmt-toolchain.toml",
]
[[bin]]
doc = false
name = "mdbook-utils"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.104"
clap = { version = "4.6.7", features = ["derive", "env"] }
console = "0.16.6"
csv = "1.4.0"
dialoguer = { version = "0.12.0", features = ["history", "completion"] }
dotenvy = "0.15.7"
enumflags2 = "0.7.12"
envy = "0.4.2"
heck = "0.5.0"
percent-encoding = "2.3.2"
pulldown-cmark = "0.13.6"
# pulldown-cmark = { version = "0.12", default-features = false, features = ["simd"] }
quick-xml = "0.42.0"
rayon = "1.12.0"
regex = "1.13.1"
serde = { version = "1.0.229", features = ["derive"] }
tempfile = "3.27.0"
toml = { version = "1.1.8", features = ["parse"] }
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
url = "2.5.8"
walkdir = "2.5.0"
[dev-dependencies]
[lints.rust]
# Prohibit unsafe code blocks across the workspace unless explicitly audited
unsafe_code = "deny"
# Require public item documentation
missing_docs = "deny"
# Require explicit lifetime parameters in type paths
elided_lifetimes_in_paths = "warn"
# Require items declared pub in private modules to be restricted (e.g. pub(crate))
unreachable_pub = "warn"
# Catch future-incompatible language and syntax changes
future_incompatible = { level = "warn", priority = -1 }
# Enforce standard naming and casing conventions
nonstandard_style = { level = "warn", priority = -1 }
# Enforce Rust 2018 idioms (e.g. bare trait objects, unused extern crates)
rust_2018_idioms = { level = "warn", priority = -1 }
# Catch identifiers colliding with names in the Rust 2021 edition prelude
rust_2021_prelude_collisions = "warn"
# Catch trailing semicolons in macro bodies used as expressions
semicolon_in_expressions_from_macros = "warn"
# Catch numeric casts between identical types that can be removed
trivial_numeric_casts = "warn"
# Catch unexpected cfg condition names or values. `cargo llvm-cov` supplies `coverage`
# when it instruments a build, allowing timing tests to distinguish measurement from execution.
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage)'] }
# Require unsafe operations inside unsafe fn to be wrapped in unsafe blocks
unsafe_op_in_unsafe_fn = "warn"
# Catch unused extern crate declarations
unused_extern_crates = "warn"
# Catch unneeded braces in import declarations
unused_import_braces = "warn"
# Catch unused lifetime declarations on generics and function signatures
unused_lifetimes = "warn"
# Allow harmless trivial casts where explicit type hints aid readability
trivial_casts = "allow"
# Allow module-qualified identifiers where qualification disambiguates domain types
unused_qualifications = "allow"
# Rustdoc documentation lints
[lints.rustdoc]
all = "warn"
# Detect broken intra-doc links within doc comments
broken_intra_doc_links = "warn"
# Detect crates missing crate-level module documentation
missing_crate_level_docs = "warn"
# See also clippy.toml
[lints.clippy]
all = { level = "warn", priority = -1 }
# ==============================================================================
# Baseline lints (Non-allow lints previously configured in repository)
# ==============================================================================
# Warns on holding a MutexGuard across an await point
await_holding_lock = "warn"
# Warns on holding a RefCell Ref or RefMut across an await point
await_holding_refcell_ref = "warn"
# Prohibits methods specified in clippy.toml (e.g. unbounded channels)
disallowed_methods = "warn"
# Prohibits names specified in clippy.toml (e.g. cmds, res, idx)
# Relaxed: serde deserialization result binding
disallowed_names = "allow"
# Checks for mutexes in an if-let pattern (relevant for pre-2024 editions)
if_let_mutex = "warn"
# Checks for TryFrom implementations that cannot fail
infallible_try_from = "warn"
# Checks for let _ = async_fn() which silently drops the returned future
let_underscore_future = "warn"
# Checks for functions returning large Err types
result_large_err = "warn"
# Checks for types used in structs, parameters and let declarations above a certain complexity threshold
type_complexity = "warn"
# ==============================================================================
# Cargo lints (Packaging and Manifest metadata)
# ==============================================================================
# Checks to see if common metadata is defined in Cargo.toml.
cargo_common_metadata = "warn"
# Checks to see if multiple versions of a crate are being used. Allowed because transitive
# dependency versions (e.g. windows, syn, thiserror) are managed via cargo-deny instead.
multiple_crate_versions = "allow"
# Checks for negative feature names with prefix no- or not-
negative_feature_names = "warn"
# Checks for feature names with prefix use-, with- or suffix -support
redundant_feature_names = "warn"
# Checks for wildcard dependencies in the Cargo.toml.
wildcard_dependencies = "warn"
# ==============================================================================
# Pedantic lints (Strict idioms, code clarity, and potential pitfalls)
# ==============================================================================
# Checks for code like foo = bar.clone();
assigning_clones = "warn"
# Instead of using an if statement to convert a bool to an int, this lint suggests using a from()
# function or an as coercion.
bool_to_int_with_if = "warn"
# Checks for the usage of &expr as *const T or &mut expr as *mut T, and suggest using &raw const or
# &raw mut instead.
borrow_as_ptr = "warn"
# Checks for calls to ends_with with possible file extensions and suggests to use a case-insensitive
# approach instead.
# Relaxed: rendered page paths are always lowercase .md
case_sensitive_file_extension_comparisons = "allow"
# Checks for casts between numeric types that can be replaced by safe conversion functions.
cast_lossless = "warn"
# Checks for casts between numeric types that may truncate large values.
cast_possible_truncation = "warn"
# Checks for casts from an unsigned type to a signed type of the same size, or possibly smaller due
# to target-dependent integers.
cast_possible_wrap = "warn"
# Checks for casts from any numeric type to a float type where the receiving type cannot store all
# values from the original type without rounding errors.
cast_precision_loss = "warn"
# Checks for casts, using as or pointer::cast, from a less strictly aligned pointer to a more
# strictly aligned pointer.
cast_ptr_alignment = "warn"
# Checks for casts from a signed to an unsigned numeric type.
cast_sign_loss = "warn"
# Checks for explicit bounds checking when casting.
checked_conversions = "warn"
# Checks for usage of cloned() on an Iterator or Option where copied() could be used instead.
cloned_instead_of_copied = "warn"
# Checks for collapsible else { if ... } expressions that can be collapsed to else if ....
collapsible_else_if = "warn"
# Checks comparison chains written with if that can be rewritten with match and cmp.
# Relaxed: if chain is clearer than match on Ordering
comparison_chain = "allow"
# Checks for types that implement Copy as well as Iterator.
copy_iterator = "warn"
# Checks for decimal literals used as bit masks in bitwise operations.
decimal_bitwise_operands = "warn"
# Checks for literal calls to Default::default().
default_trait_access = "warn"
# Checks the doc comments have unbroken links, mostly caused by bad formatted links such as broken
# across multiple lines.
doc_broken_link = "warn"
# Detects doc comments that use double spaces as hard line break, instead of backslash (\).
doc_comment_double_space_linebreaks = "warn"
# Detects the syntax ['foo'] in documentation comments (notice quotes instead of backticks) outside
# of code blocks
doc_link_with_quotes = "warn"
# Checks for the presence of _, :: or camel-case words outside ticks in documentation.
doc_markdown = "warn"
# Checks for instances where a std::time::Duration is constructed using a smaller time unit when the
# value could be expressed more clearly using a larger unit.
duration_suboptimal_units = "warn"
# Checks for lifetime annotations which can be replaced with anonymous lifetimes ('_).
elidable_lifetime_names = "warn"
# Checks for use Enum::*.
enum_glob_use = "warn"
# Checks for explicit Clone implementations for Copy types.
expl_impl_clone_on_copy = "warn"
# Checks for explicit deref() or deref_mut() method calls.
explicit_deref_methods = "warn"
# Checks for loops on y.into_iter() where y will do, and suggests the latter.
explicit_into_iter_loop = "warn"
# Checks for loops on x.iter() where &x will do, and suggests the latter.
explicit_iter_loop = "warn"
# Checks for usage of _.filter_map(_).next().
filter_map_next = "warn"
# Checks for usage of Iterator::flat_map() where filter_map() could be used instead.
flat_map_option = "warn"
# Checks for (in-)equality comparisons on floating-point values (apart from zero), except in
# functions called *eq* (which probably implement equality for a type involving floats).
float_cmp = "warn"
# Checks for excessive use of bools in function declarations.
fn_params_excessive_bools = "warn"
# Checks for usage of .map(|_| format!(..)).collect::<String>().
format_collect = "warn"
# Detects cases where the result of a format! call is appended to an existing String.
# Relaxed: clarity over allocation in a rarely-run command
format_push_string = "allow"
# Checks for usage of ! or != in an if condition with an else branch.
if_not_else = "warn"
# Checks for ignored tests without messages.
ignore_without_reason = "warn"
# Checks for usage of _ in patterns of type ().
ignored_unit_patterns = "warn"
# Checks for the usage of _.to_owned(), vec.to_vec(), or similar when calling _.clone() would be
# clearer.
implicit_clone = "warn"
# Checks for public impl or fn missing generalization over different hashers and implicitly
# defaulting to the default hashing algorithm (SipHash).
implicit_hasher = "warn"
# Checks for struct constructors where the order of the field init in the constructor is
# inconsistent with the order in the struct definition.
inconsistent_struct_constructor = "warn"
# The lint checks for slice bindings in patterns that are only used to access individual slice
# values.
index_refutable_slice = "warn"
# Checks for usage of .to_string() on an &&T where T implements ToString directly (like &&str or
# &&String).
inefficient_to_string = "warn"
# Checks for items annotated with #[inline(always)], unless the annotated function is empty or
# simply panics.
inline_always = "warn"
# This is the opposite of the iter_without_into_iter lint.
into_iter_without_iter = "warn"
# Checks for comparisons where the relation is always either true or false, but where one side has
# been upcast so that the comparison is necessary.
invalid_upcast_comparisons = "warn"
# Checks for IP addresses that could be replaced with predefined constants such as
# Ipv4Addr::new(127, 0, 0, 1) instead of using the appropriate constants.
ip_constant = "warn"
# Checks for items declared after some statement in a block.
items_after_statements = "warn"
# Checks for usage of .filter(Result::is_ok) that may be replaced with a .flatten() call.
iter_filter_is_ok = "warn"
# Checks for usage of .filter(Option::is_some) that may be replaced with a .flatten() call.
iter_filter_is_some = "warn"
# Detects methods named iter or iter_mut that do not have a return type that implements Iterator.
iter_not_returning_iterator = "warn"
# Looks for iter and iter_mut methods without an associated IntoIterator for (&|&mut) Type
# implementation.
iter_without_into_iter = "warn"
# Warns if the digits of an integral or floating-point constant are grouped into groups that are too
# large.
large_digit_groups = "warn"
# It checks for the size of a Future created by async fn or async {}.
large_futures = "warn"
# Checks for local arrays that may be too large.
large_stack_arrays = "warn"
# Checks for functions taking arguments by value, where the argument type is Copy and large enough
# to be worth considering passing by reference.
large_types_passed_by_value = "warn"
# Checks for usage of any LinkedList, suggesting to use a Vec or a VecDeque (formerly called
# RingBuf).
linkedlist = "warn"
# Checks for #[macro_use] use....
macro_use_imports = "warn"
# Detects if-then-panic! that can be replaced with assert!.
manual_assert = "warn"
# Checks for assert! and debug_assert! that consist of only an (in)equality check
manual_assert_eq = "warn"
# Checks for usage of T::BITS - x.leading_zeros() when x.bit_width() is available.
manual_bits = "warn"
# Checks for expressions like N - x.leading_zeros() (where N is one less than bit width of x) or
# x.ilog(2), which are manual reimplementations of x.ilog2()
manual_ilog2 = "warn"
# Lints subtraction between Instant::now() and another Instant.
manual_instant_elapsed = "warn"
# Checks for expressions like x.count_ones() == 1 or x & (x - 1) == 0, with x and unsigned integer,
# which may be manual reimplementations of x.is_power_of_two().
manual_is_power_of_two = "warn"
# Checks for usage of option.map(f).unwrap_or_default() and result.map(f).unwrap_or_default() where
# f is a function or closure that returns the bool type.
manual_is_variant_and = "warn"
# Warn of cases where let...else could be used
manual_let_else = "warn"
# Checks for manual implementation of midpoint.
manual_midpoint = "warn"
# Checks for usage of "" to create a String, such as "".to_string(), "".to_owned(), String::from("")
# and others.
manual_string_new = "warn"
# Checks for too many variables whose name consists of a single character.
many_single_char_names = "warn"
# Checks for usage of option.map(_).unwrap_or(_) or option.map(_).unwrap_or_else(_) or
# result.map(_).unwrap_or_else(_).
map_unwrap_or = "warn"
# Checks for matches where match expression is a bool.
match_bool = "warn"
# Checks for match with identical arm bodies.
match_same_arms = "warn"
# Checks for arm which matches all errors with Err(_) and take drastic actions like panic!.
match_wild_err_arm = "warn"
# Checks for wildcard enum matches for a single variant.
match_wildcard_for_single_variants = "warn"
# Checks for iteration that may be infinite.
maybe_infinite_iter = "warn"
# Checks for type parameters which are positioned inconsistently between a type definition and impl
# block.
mismatching_type_param_order = "warn"
# Checks the doc comments of publicly visible functions that return a Result type and warns if there
# is no # Errors section.
missing_errors_doc = "warn"
# Checks for manual core::fmt::Debug implementations that do not use all fields.
missing_fields_in_debug = "warn"
# Checks the doc comments of publicly visible functions that may panic and warns if there is no #
# Panics section.
missing_panics_doc = "warn"
# Checks for public functions that have no #[must_use] attribute, but return something not already
# marked must-use, have no mutable arg and mutate no statics.
must_use_candidate = "warn"
# Checks for instances of mut mut references.
mut_mut = "warn"
# Checks for naive byte counts
naive_bytecount = "warn"
# Checks for usage of bitwise and/or operators between booleans, where performance may be improved
# by using a lazy and.
needless_bitwise_bool = "warn"
# The lint checks for if-statements appearing in loops that contain a continue statement in either
# their main blocks or their else-blocks, when omitting the else-block possibly with some
# rearrangement of code can make the code easier to understand.
needless_continue = "warn"
# Checks for usage of for_each that would be more simply written as a for loop.
needless_for_each = "warn"
# Checks for functions taking arguments by value, but not consuming them in its body.
# Relaxed: owned arguments keep CLI command APIs simple
needless_pass_by_value = "allow"
# Checks for raw string literals with an unnecessary amount of hashes around them.
needless_raw_string_hashes = "warn"
# Checks for binding to underscore prefixed variable without side-effects.
no_effect_underscore_binding = "warn"
# Checks for Rust ABI functions with the #[no_mangle] attribute.
no_mangle_with_rust_abi = "warn"
# Lints when once_cell::sync::Lazy or lazy_static! are used to define a static variable, and
# suggests replacing such cases with std::sync::LazyLock instead.
non_std_lazy_statics = "warn"
# Checks for boolean expressions that can be written more concisely.
nonminimal_bool = "warn"
# Checks for usage of .as_ref().cloned() and .as_mut().cloned() on Options
option_as_ref_cloned = "warn"
# Checks for usage of Option<Option<_>> in function signatures and type definitions
option_option = "warn"
# Checks for boolean expressions that contain terminals that can be eliminated.
overly_complex_bool_expr = "warn"
# Checks for as casts between raw pointers that don’t change their constness, namely *const T to
# *const U and *mut T to *mut U.
ptr_as_ptr = "warn"
# Checks for as casts between raw pointers that change their constness, namely *const T to *mut T
# and *mut T to *const T.
ptr_cast_constness = "warn"
# Checks for usage of the offset pointer method with an integer literal.
ptr_offset_by_literal = "warn"
# Checks whether any field of the struct is prefixed with an _ (underscore) and also marked pub
# (public)
pub_underscore_fields = "warn"
# Checks for inclusive ranges where 1 is subtracted from the upper bound, e.g., x..=(y-1).
range_minus_one = "warn"
# Checks for exclusive ranges where 1 is added to the upper bound, e.g., x..(y+1).
range_plus_one = "warn"
# Checks for closures which only invoke a method on the closure argument and can be replaced by
# referencing the method directly.
redundant_closure_for_method_calls = "warn"
# Checks for else blocks that can be removed without changing semantics.
redundant_else = "warn"
# Checks for casts of references to pointer using as and suggests std::ptr::from_ref and
# std::ptr::from_mut instead.
ref_as_ptr = "warn"
# Checks for ref bindings which create a reference to a reference.
ref_binding_to_reference = "warn"
# Warns when a function signature uses &Option<T> instead of Option<&T>.
ref_option = "warn"
# Checks for usage of &Option<&T>.
ref_option_ref = "warn"
# This lint warns when a method returning Self doesn’t have the #[must_use] attribute.
return_self_not_must_use = "warn"
# Checks for consecutive ifs with the same function call.
same_functions_in_if_condition = "warn"
# Checks for usages of Vec::from_raw_parts and String::from_raw_parts where the same expression is
# used for the length and the capacity.
same_length_and_capacity = "warn"
# Checks for self receiver that is only used in recursion with no side-effects.
self_only_used_in_recursion = "warn"
# Looks for blocks of expressions and fires if the last expression returns () but is not followed by
# a semicolon.
semicolon_if_nothing_returned = "warn"
# Checks for #[should_panic] attributes without specifying the expected panic message.
should_panic_without_expect = "warn"
# Checks for names that are very similar and thus confusing.
similar_names = "allow"
# Checks for string methods that receive a single-character str as an argument, e.g., _.split("x").
single_char_pattern = "warn"
# Checks for matches with two arms where an if let else will usually suffice.
single_match_else = "warn"
# When sorting primitive values (integers, bools, chars, as well as arrays, slices, and tuples of
# such items), it is typically better to use an unstable sort than a stable sort.
stable_sort_primitive = "warn"
# Checks for usages of str.trim().split("\n") and str.trim().split("\r\n").
str_split_at_newline = "warn"
# Checks for string appends of the form x = x + y (without let!).
string_add_assign = "warn"
# Checks for excessive use of bools in structs.
struct_excessive_bools = "warn"
# Detects struct fields that are prefixed or suffixed by the same characters or the name of the
# struct itself.
# Relaxed: field names mirror the pulldown-cmark vocabulary
struct_field_names = "allow"
# Checks for functions with a large amount of lines.
# Relaxed: large match-based dispatchers
too_many_lines = "allow"
# Checks for transmutes from a pointer to a pointer, or from a reference to a reference.
transmute_ptr_to_ptr = "warn"
# Checks for functions taking arguments by reference, where the argument type is Copy and small
# enough to be more efficient to always pass by value.
# Relaxed: bitflags set is passed by reference to match sibling helpers
trivially_copy_pass_by_ref = "allow"
# Lints subtraction between an Instant and a Duration, or between two Duration values.
unchecked_time_subtraction = "warn"
# Checks for string literals that contain Unicode in a form that is not equal to its
# NFC-recomposition.
unicode_not_nfc = "warn"
# Detect when a variable is not inlined in a format string, and suggests to inline it.
uninlined_format_args = "warn"
# Checks for a return type containing a Box<T> where T implements Sized
unnecessary_box_returns = "warn"
# Checks for Debug formatting ({:?}) applied to an OsStr or Path.
# Relaxed: Debug formatting of paths keeps quoting visible in error messages
unnecessary_debug_formatting = "allow"
# Checks for usage of .collect::<Vec<String>>().join("") on iterators.
unnecessary_join = "warn"
# Detects functions that are written to return &str that could return &'static str but instead
# return a &'a str.
unnecessary_literal_bound = "warn"
# Checks for the presence of a semicolon at the end of a match or if statement evaluating to ().
unnecessary_semicolon = "warn"
# Suggests removing an unnecessary trailing comma before the closing parenthesis in single-line
# macro invocations.
unnecessary_trailing_comma = "warn"
# Checks for private functions that only return Ok or Some.
unnecessary_wraps = "warn"
# Checks for unnested or-patterns, e.g., Some(0) | Some(2) and suggests replacing the pattern with a
# nested one, Some(0 | 2).
unnested_or_patterns = "warn"
# Warns if a long integral or floating-point constant does not contain underscores.
unreadable_literal = "warn"
# Checks for deriving serde::Deserialize on a type that has methods using unsafe.
unsafe_derive_deserialize = "warn"
# Checks for functions that are declared async but have no .awaits inside of them.
unused_async = "warn"
# Checks for trait method implementations that are declared async but have no .awaits inside of
# them.
# Checks methods that contain a self argument but don’t use it
unused_self = "warn"
# Checks for the use of bindings with a single leading underscore.
used_underscore_binding = "warn"
# Checks for the use of item with a single leading underscore.
used_underscore_items = "warn"
# Checks for bit masks that can be replaced by a call to trailing_zeros
verbose_bit_mask = "warn"
# Checks for wildcard imports use _::*.
wildcard_imports = "warn"
# Checks for calls to with_capacity(0) on standard library collections and types.
# Checks for maps with zero-sized value types anywhere in the code.
zero_sized_map_values = "warn"
# ==============================================================================
# Restriction lints (Strict opt-in rules and language feature restrictions)
# ==============================================================================
# Checks for usage of items through absolute paths, like std::f64::consts::PI.
absolute_paths = "warn"
# Finds items imported through alloc when available through core.
alloc_instead_of_core = "warn"
# Checks for usage of the #[allow] attribute and suggests replacing it with the #[expect] attribute
# (See RFC 2383)
allow_attributes = "warn"
# Checks for attributes that allow lints without a reason.
allow_attributes_without_reason = "warn"
# Confirms that items are sorted in source files as per configuration.
arbitrary_source_item_ordering = "allow"
# Checks any kind of arithmetic operation of any type.
# Relaxed: Offsets and counts are bounded by the input being processed.
arithmetic_side_effects = "allow"
# Checks for usage of as conversions.
as_conversions = "warn"
# Checks for the usage of as *const _ or as *mut _ conversion using inferred type.
as_pointer_underscore = "warn"
# Checks for the usage of as _ conversion using inferred type.
as_underscore = "warn"
# Checks for assert!(r.is_ok()) or assert!(r.is_err()) calls.
assertions_on_result_states = "warn"
# Checks for the usage of the to_be_bytes method and/or the function from_be_bytes.
big_endian_bytes = "warn"
# Checks for usage of cfg that excludes code from test builds.
cfg_not_test = "warn"
# Checks for usage of .clone() on a ref-counted pointer, (Rc, Arc, rc::Weak, or sync::Weak), and
# suggests calling Clone via unified function syntax instead (e.g., Rc::clone(foo)).
clone_on_ref_ptr = "warn"
# We used to think it measured how hard a method is to understand.
# Relaxed: event-loop parsers are inherently branchy
cognitive_complexity = "allow"
# Checks usage of std::fs::create_dir and suggest using std::fs::create_dir_all instead.
# Relaxed: tests deliberately create single directories in fresh temp dirs
create_dir = "allow"
# Checks for usage of the dbg! macro.
dbg_macro = "warn"
# Warns if there is a better representation for a numeric literal.
decimal_literal_representation = "warn"
# Checks for usage of unconstrained numeric literals which may cause default numeric fallback in
# type inference.
# Relaxed: counter literals default to i32 safely
default_numeric_fallback = "allow"
# Displays a warning when a union is declared with the default representation (without a #[repr(C)]
# attribute).
default_union_representation = "warn"
# Checks for definitions (structs, functions, traits, etc.) in mod.rs files.
# Checks for slicing expressions which are equivalent to dereferencing the value.
deref_by_slicing = "warn"
# Checks for usage of unicode scripts other than those explicitly allowed by the lint config.
disallowed_script_idents = "warn"
# Checks if included files in doc comments are included only for cfg(doc).
doc_include_without_cfg = "warn"
# Checks for doc comments whose paragraphs do not end with a period or another punctuation mark.
# Relaxed: The human-owned 'TODO Reviewed' markers in module docs must stay verbatim.
doc_paragraphs_missing_punctuation = "allow"
# Checks for usage of if expressions with an else if branch, but without a final else branch.
else_if_without_else = "allow"
# Checks for empty Drop implementations.
empty_drop = "warn"
# Finds enum variants without fields that are declared with empty brackets.
empty_enum_variants_with_brackets = "warn"
# Finds structs without fields (a so-called “empty struct”) that are declared with brackets.
empty_structs_with_brackets = "warn"
# Checks for types named Error that implement Error.
error_impl_error = "warn"
# Warns on any exported enums that are not tagged #[non_exhaustive]
# Relaxed: Matching the public enums exhaustively is intended.
exhaustive_enums = "allow"
# Warns on any exported structs that are not tagged #[non_exhaustive]
# Relaxed: Public records are constructed directly by the CLI, tests and callers.
exhaustive_structs = "allow"
# Detects calls to the exit() function that are not in the main function.
exit = "warn"
# Checks for .expect() or .expect_err() calls on Results and .expect() call on Options.
# Relaxed: regex literals and constant URLs are validated by tests
expect_used = "allow"
# Checks for usage of scoped visibility modifiers, like pub(crate), on fields. Allowed because
# repository guidelines and unreachable_pub mandate restricted field visibility.
field_scoped_visibility_modifiers = "allow"
# Checks for FileType::is_file().
# Relaxed: symlinks and special files are intentionally skipped
filetype_is_file = "allow"
# Checks for float arithmetic.
float_arithmetic = "allow"
# Checks for (in-)equality comparisons on constant floating-point values (apart from zero), except
# in functions called *eq* (which probably implement equality for a type involving floats).
float_cmp_const = "warn"
# Checks for casts of a function pointer to any integer type.
fn_to_numeric_cast_any = "warn"
# Checks for usage of .get().unwrap() (or .get_mut().unwrap) on a standard library type which
# implements Index
get_unwrap = "warn"
# Checks for the usage of the to_ne_bytes method and/or the function from_ne_bytes.
host_endian_bytes = "warn"
# Checks for if-else that could be written using either bool::then or bool::then_some.
if_then_some_else_none = "warn"
# Lints when impl Trait is being used in a function’s parameters.
impl_trait_in_params = "warn"
# Checks for missing return statements at the end of a block.
implicit_return = "allow"
# Checks for usage of indexing or slicing that may panic at runtime.
# Relaxed: indices are validated just before use; revisit incrementally
indexing_slicing = "allow"
# Checks for infinite loops in a function where the return type is not ! and lint accordingly.
infinite_loop = "warn"
# Checks for usage of AT&T x86 assembly syntax.
inline_asm_x86_att_syntax = "warn"
# Checks for usage of Intel x86 assembly syntax.
inline_asm_x86_intel_syntax = "warn"
# Allows module layout that uses inline modules.
inline_modules = "allow"
# Do not enforce that where bounds are used for all trait bounds.
inline_trait_bounds = "allow"
# Checks for division of integers
integer_division = "warn"
# Checks for the usage of division (/) and remainder (%) operations when performed on any integer
# types using the default Div and Rem trait implementations.
integer_division_remainder_used = "warn"
# This is a restriction lint which prevents the use of hash types (i.e., HashSet and HashMap) in for
# loops.
iter_over_hash_type = "warn"
# Checks for the inclusion of large files via include_bytes!() or include_str!().
large_include_file = "warn"
# Checks for let _ = <expr> where expr is #[must_use]
let_underscore_must_use = "warn"
# Checks for let _ = <expr> without a type annotation, and suggests to either provide one, or remove
# the let keyword altogether.
let_underscore_untyped = "allow"
# Checks for the usage of the to_le_bytes method and/or the function from_le_bytes.
little_endian_bytes = "warn"
# Checks for whole number float literals that cannot be represented as the underlying type without
# loss.
lossy_float_literal = "warn"
# Checks for instances of map_err(|_| Some::Enum)
# Relaxed: the original error is irrelevant for invalid URL messages
map_err_ignore = "allow"
# Checks for Iterator::map over ranges without using the parameter which could be more clearly
# expressed using std::iter::repeat(...).take(...) or std::iter::repeat_n.
map_with_unused_argument_over_ranges = "warn"
# Checks for usage of std::mem::forget(t) where t is Drop or has a field that implements Drop.
mem_forget = "warn"
# Checks for identifiers which consist of a single character (or fewer than the configured
# threshold).
# Relaxed: short closure parameter names are idiomatic
min_ident_chars = "allow"
# Checks assertions without a custom panic message.
missing_assert_message = "warn"
# Checks for repeated slice indexing without asserting beforehand that the length is greater than
# the largest index used to index into the slice.
# Relaxed: windows(2) guarantees two elements
missing_asserts_for_indexing = "allow"
# Warns if there is missing documentation for any private documentable item.
missing_docs_in_private_items = "warn"
# It lints if an exported function, method, trait method with default impl, or trait method impl is
# not #[inline].
missing_inline_in_public_items = "allow"
# Checks if a provided method is used implicitly by a trait implementation.
missing_trait_methods = "allow"
# Checks for a read and a write to the same variable where whether the read occurs before or after
# the write depends on the evaluation order of sub-expressions.
mixed_read_write_in_expression = "warn"
# Checks that module layout uses only self named module files; bans mod.rs files.
mod_module_files = "allow"
# Detects public item names that are prefixed or suffixed by the containing public module’s name.
# Allowed because repository guidelines mandate naming implementation modules with type prefixes.
module_name_repetitions = "allow"
# Checks for modulo arithmetic.
modulo_arithmetic = "warn"
# Checks for multiple inherent implementations of a struct
multiple_inherent_impl = "allow"
# Checks for unsafe blocks that contain more than one unsafe operation.
multiple_unsafe_ops_per_block = "allow"
# Checks for usage of Mutex<X> where an atomic will do.
mutex_atomic = "warn"
# Checks for usage of Mutex<X> where X is an integral type.
mutex_integer = "warn"
# Checks for raw string literals where a string literal can be used instead.
needless_raw_strings = "warn"
# Checks for non-ASCII characters in string and char literals.
# Relaxed: a test deliberately uses non-ASCII markdown
non_ascii_literal = "allow"
# Checks for conversions from NonZero types to regular integer types, and suggests using NonZero
# types for the target as well.
non_zero_suggestions = "warn"
# Checks for usage of panic!.
# Relaxed: invalid built-in regex rules are programming errors
panic = "allow"
# Checks for usage of panic! or assertions in a function whose return type is Result.
# Relaxed: Test functions that return Result still assert; production code propagates errors instead.
panic_in_result_fn = "allow"
# Checks whether some but not all fields of a struct are public.
partial_pub_fields = "warn"
# Checks for calls to push immediately after creating a new PathBuf.
pathbuf_init_then_push = "warn"
# Checks for patterns that aren’t exact representations of the types they are applied to.
# Relaxed: Default binding modes are idiomatic when matching on references.
pattern_type_mismatch = "allow"
# Detects pointer format as well as Debug formatting of raw pointers or function pointers or any
# types that have a derived Debug impl that recursively contains them.
pointer_format = "warn"
# Checks for bit shifting operations combined with bit masking/combining operators and suggest using
# parentheses.
precedence_bits = "warn"
# Checks for printing on stderr. The purpose of this lint is to catch debugging remnants.
# Relaxed: This is a command-line tool; stderr carries its diagnostics.
print_stderr = "allow"
# Checks for printing on stdout. The purpose of this lint is to catch debugging remnants.
# Relaxed: This is a command-line tool; stdout is its output channel.
print_stdout = "allow"
# Restricts the usage of pub use ...
pub_use = "allow"
# Checks for usage of pub(<loc>) with in.
pub_with_shorthand = "allow"
# Checks for usage of pub(<loc>) without in.
pub_without_shorthand = "allow"
# Checks for expressions that use the ? operator and rejects them.
question_mark_used = "allow"
# Checks for Rc<T> and Arc<T> when T is a mutable buffer type such as String or Vec.
rc_buffer = "warn"
# Checks for Rc<Mutex<T>>.
rc_mutex = "warn"