1- #![ feature( div_duration) ]
21#![ feature( int_roundings) ]
32#![ no_main]
43use comrak:: {
@@ -35,6 +34,7 @@ enum Markdown {
3534 // foofoo
3635 // foofoofoo
3736 // foofoofoofoo
37+ #[ allow( clippy:: enum_variant_names) ]
3838 Markdown {
3939 markdown : String ,
4040 } ,
@@ -92,11 +92,11 @@ impl Markdown {
9292
9393 // Place the markdown in `output`
9494 for _ in 0 ..iterations {
95- output. push_str ( & prefix)
95+ output. push_str ( prefix)
9696 }
97- output. push_str ( & markdown) ;
97+ output. push_str ( markdown) ;
9898 for _ in 0 ..iterations {
99- output. push_str ( & suffix)
99+ output. push_str ( suffix)
100100 }
101101 }
102102 output
@@ -117,9 +117,9 @@ impl Markdown {
117117
118118 // Place the markdown in `output`
119119 for _ in 0 ..iterations {
120- output. push_str ( & prefix)
120+ output. push_str ( prefix)
121121 }
122- output. push_str ( & markdown) ;
122+ output. push_str ( markdown) ;
123123 }
124124 output
125125 }
@@ -131,7 +131,7 @@ impl Markdown {
131131 }
132132
133133 fn should_fuzz_string ( s : & str ) -> bool {
134- if s. len ( ) == 0 {
134+ if s. is_empty ( ) {
135135 // Repeating a zero-length string is useless
136136 return false ;
137137 }
@@ -147,18 +147,18 @@ impl Markdown {
147147 /// A filter to guiding the fuzzer. The fuzzer will skip any input which fails this predicate
148148 fn should_fuzz ( & self ) -> bool {
149149 match self {
150- Markdown :: Markdown { markdown } => Markdown :: should_fuzz_string ( & markdown) ,
150+ Markdown :: Markdown { markdown } => Markdown :: should_fuzz_string ( markdown) ,
151151 Markdown :: Sandwich {
152152 prefix,
153153 markdown,
154154 suffix,
155155 } => {
156- Markdown :: should_fuzz_string ( & prefix)
157- && Markdown :: should_fuzz_string ( & markdown)
158- && Markdown :: should_fuzz_string ( & suffix)
156+ Markdown :: should_fuzz_string ( prefix)
157+ && Markdown :: should_fuzz_string ( markdown)
158+ && Markdown :: should_fuzz_string ( suffix)
159159 }
160160 Markdown :: Tree { prefix, markdown } => {
161- Markdown :: should_fuzz_string ( & prefix) && Markdown :: should_fuzz_string ( & markdown)
161+ Markdown :: should_fuzz_string ( prefix) && Markdown :: should_fuzz_string ( markdown)
162162 }
163163 }
164164 }
@@ -172,7 +172,7 @@ struct FuzzOptions {
172172}
173173
174174impl FuzzOptions {
175- fn to_options ( & self ) -> Options {
175+ fn to_options ( & self ) -> Options < ' _ > {
176176 Options {
177177 extension : self . extension . to_options ( ) ,
178178 parse : self . parse . to_options ( ) ,
@@ -204,29 +204,30 @@ struct FuzzExtensionOptions {
204204}
205205
206206impl FuzzExtensionOptions {
207- fn to_options ( & self ) -> ExtensionOptions {
208- let mut extension = ExtensionOptions :: default ( ) ;
209- extension. strikethrough = self . strikethrough ;
210- extension. tagfilter = self . tagfilter ;
211- extension. table = self . table ;
212- extension. autolink = self . autolink ;
213- extension. tasklist = self . tasklist ;
214- extension. superscript = self . superscript ;
215- extension. footnotes = self . footnotes ;
216- extension. description_lists = self . description_lists ;
217- extension. multiline_block_quotes = self . multiline_block_quotes ;
218- extension. math_dollars = self . math_dollars ;
219- extension. math_code = self . math_code ;
220- extension. shortcodes = self . shortcodes ;
221- extension. wikilinks_title_after_pipe = self . wikilinks_title_after_pipe ;
222- extension. wikilinks_title_before_pipe = self . wikilinks_title_before_pipe ;
223- extension. underline = self . underline ;
224- extension. spoiler = self . spoiler ;
225- extension. greentext = self . greentext ;
226- extension. alerts = self . alerts ;
227- extension. front_matter_delimiter = None ;
228- extension. header_ids = None ;
229- extension
207+ fn to_options ( & self ) -> ExtensionOptions < ' _ > {
208+ ExtensionOptions {
209+ strikethrough : self . strikethrough ,
210+ tagfilter : self . tagfilter ,
211+ table : self . table ,
212+ autolink : self . autolink ,
213+ tasklist : self . tasklist ,
214+ superscript : self . superscript ,
215+ footnotes : self . footnotes ,
216+ description_lists : self . description_lists ,
217+ multiline_block_quotes : self . multiline_block_quotes ,
218+ math_dollars : self . math_dollars ,
219+ math_code : self . math_code ,
220+ shortcodes : self . shortcodes ,
221+ wikilinks_title_after_pipe : self . wikilinks_title_after_pipe ,
222+ wikilinks_title_before_pipe : self . wikilinks_title_before_pipe ,
223+ underline : self . underline ,
224+ spoiler : self . spoiler ,
225+ greentext : self . greentext ,
226+ alerts : self . alerts ,
227+ front_matter_delimiter : None ,
228+ header_ids : None ,
229+ ..Default :: default ( )
230+ }
230231 }
231232}
232233
@@ -238,13 +239,14 @@ struct FuzzParseOptions {
238239}
239240
240241impl FuzzParseOptions {
241- fn to_options ( & self ) -> ParseOptions {
242- let mut parse = ParseOptions :: default ( ) ;
243- parse. smart = self . smart ;
244- parse. default_info_string = None ;
245- parse. relaxed_tasklist_matching = self . relaxed_tasklist_matching ;
246- parse. relaxed_autolinks = self . relaxed_autolinks ;
247- parse
242+ fn to_options ( & self ) -> ParseOptions < ' _ > {
243+ ParseOptions {
244+ smart : self . smart ,
245+ default_info_string : None ,
246+ relaxed_tasklist_matching : self . relaxed_tasklist_matching ,
247+ relaxed_autolinks : self . relaxed_autolinks ,
248+ ..Default :: default ( )
249+ }
248250 }
249251}
250252
@@ -263,17 +265,18 @@ struct FuzzRenderOptions {
263265
264266impl FuzzRenderOptions {
265267 fn to_options ( & self ) -> RenderOptions {
266- let mut render = RenderOptions :: default ( ) ;
267- render. hardbreaks = self . hardbreaks ;
268- render. github_pre_lang = self . github_pre_lang ;
269- render. full_info_string = self . full_info_string ;
270- render. width = self . width ;
271- render. unsafe_ = self . unsafe_ ;
272- render. escape = self . escape ;
273- render. list_style = self . list_style ;
274- render. sourcepos = self . sourcepos ;
275- render. escaped_char_spans = self . escaped_char_spans ;
276- render
268+ RenderOptions {
269+ hardbreaks : self . hardbreaks ,
270+ github_pre_lang : self . github_pre_lang ,
271+ full_info_string : self . full_info_string ,
272+ width : self . width ,
273+ unsafe_ : self . unsafe_ ,
274+ escape : self . escape ,
275+ list_style : self . list_style ,
276+ sourcepos : self . sourcepos ,
277+ escaped_char_spans : self . escaped_char_spans ,
278+ ..Default :: default ( )
279+ }
277280 }
278281}
279282
0 commit comments