File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -8,22 +8,22 @@ use crate::{Config, ErrorKind};
8
8
9
9
pub ( crate ) fn format_cargo_toml_inner ( content : & str , config : & Config ) -> Result < String , ErrorKind > {
10
10
let mut doc = content. parse :: < toml_edit:: Document > ( ) ?;
11
- let rules: Vec < Box < dyn VisitMut > > = vec ! [
12
- Box :: new ( SortSection {
11
+ let rules = [
12
+ & mut SortSection {
13
13
current_position : 0 ,
14
- } ) ,
15
- Box :: new ( SortKey ) ,
16
- Box :: new ( BlankLine { trimming: true } ) ,
17
- Box :: new ( KeyValue ) ,
18
- Box :: new ( MultiLine ) ,
19
- Box :: new ( WrapArray {
14
+ } as & mut dyn VisitMut ,
15
+ & mut SortKey ,
16
+ & mut BlankLine { trimming : true } ,
17
+ & mut KeyValue ,
18
+ & mut MultiLine ,
19
+ & mut WrapArray {
20
20
max_width : config. max_width ( ) ,
21
- } ) ,
22
- Box :: new ( FormatInlineTable {
21
+ } ,
22
+ & mut FormatInlineTable {
23
23
max_width : config. max_width ( ) ,
24
24
long_tables : vec ! [ ] ,
25
25
current_section : String :: new ( ) ,
26
- } ) ,
26
+ } ,
27
27
] ;
28
28
for mut rule in rules. into_iter ( ) {
29
29
rule. visit_document_mut ( & mut doc) ;
You can’t perform that action at this time.
0 commit comments