Skip to main content

HEADER

Constant HEADER 

Source
pub const HEADER: &str = "// Code generated by oapi-codegen-rust. DO NOT EDIT.
#![allow(
    dead_code,
    clippy::all,
    clippy::pedantic,
    clippy::nursery,
    clippy::restriction,
    reason = \"generated code, not first-party source\"
)]

";
Expand description

Header prepended to every generated file: the do-not-edit marker, then a blanket clippy allowance.

Clippy is the compiler, so a lint level belongs to the module tree and not to a path. There is no exclude key and no blanket switch: #![allow(clippy)] is an unknown lint and #![allow(clippy::*)] does not parse. Both measured. The four groups below hold every clippy lint, including any a later release adds, so this never tracks a lint list.

dead_code is a rustc lint, so the groups miss it. A generated file offers every type the specification declares, and a consumer uses the ones it needs.

An inner attribute needs the file to be a module. #[path = "..."] mod x; reads a generated file, and include! cannot, because rustc rejects an inner attribute in a paste.