Debian Codegraph @

debian/rust-vendor/textwrap/src/fuzzing.rs

raw
1 //! Fuzzing helpers.
2
3 use super::Options;
4 use alloc::borrow::Cow;
5 use alloc::string::String;
6 use alloc::vec::Vec;
7
8 /// Exposed for fuzzing so we can check the slow path is correct.
9 pub fn fill_slow_path<'a>(text: &str, options: Options<'_>) -> String {
10 crate::fill::fill_slow_path(text, options)
11 }
12
13 /// Exposed for fuzzing so we can check the slow path is correct.
14 pub fn wrap_single_line<'a>(line: &'a str, options: &Options<'_>, lines: &mut Vec<Cow<'a, str>>) {
15 crate::wrap::wrap_single_line(line, options, lines);
16 }
17
18 /// Exposed for fuzzing so we can check the slow path is correct.
19 pub fn wrap_single_line_slow_path<'a>(
20 line: &'a str,
21 options: &Options<'_>,
22 lines: &mut Vec<Cow<'a, str>>,
23 ) {
24 crate::wrap::wrap_single_line_slow_path(line, options, lines)
25 }