Skip to main content

MAX_FORMAT_STRING_LEN

Constant MAX_FORMAT_STRING_LEN 

Source
pub const MAX_FORMAT_STRING_LEN: usize = _; // 1_048_576usize
Expand description

Maximum permitted input length (in bytes) for FormatString::new.

Caps the raw source text a format string may carry. Templates this large are almost certainly pathological inputs rather than real user content — 1 MB is several orders of magnitude above the size of the largest known legitimate template fields.

See specs/expr/format-string.md (Defensive caps) for rationale.