File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -59,16 +59,22 @@ impl Keyword {
59
59
keyword : & ' a str ,
60
60
}
61
61
62
- let ( lowercase_names, new_keywords) : ( Vec < _ > , Vec < _ > ) = names. iter ( )
63
- . map ( |s| ( s. to_lowercase ( ) , NewKeyword { keyword : * s } ) )
64
- . unzip ( ) ;
62
+ let lowercase_names: Vec < _ > = names. iter ( )
63
+ . map ( |s| s. to_lowercase ( ) )
64
+ . collect ( ) ;
65
+
66
+ let new_keywords: Vec < _ > = lowercase_names. iter ( )
67
+ . map ( |s| NewKeyword { keyword : s } )
68
+ . collect ( ) ;
65
69
66
70
// https://github.com/diesel-rs/diesel/issues/797
67
71
if !new_keywords. is_empty ( ) {
68
- diesel:: insert ( & new_keywords. on_conflict_do_nothing ( ) ) . into ( keywords:: table)
72
+ diesel:: insert ( & new_keywords. on_conflict_do_nothing ( ) )
73
+ . into ( keywords:: table)
69
74
. execute ( conn) ?;
70
75
}
71
- keywords:: table. filter ( :: lower ( keywords:: keyword) . eq ( any ( lowercase_names) ) )
76
+ keywords:: table
77
+ . filter ( :: lower ( keywords:: keyword) . eq ( any ( & lowercase_names) ) )
72
78
. load ( conn)
73
79
}
74
80
You can’t perform that action at this time.
0 commit comments