File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -179,20 +179,23 @@ fn get_previous_positions(events: &[Events], mut pos: usize) -> Vec<usize> {
179179}
180180
181181fn build_rule ( v : & [ u8 ] , positions : & [ usize ] ) -> String {
182- positions
183- . chunks ( 2 )
184- . map ( |x| :: std:: str:: from_utf8 ( & v[ x[ 0 ] ..x[ 1 ] ] ) . unwrap_or ( "" ) )
185- . collect :: < String > ( )
186- . trim ( )
187- . replace ( "\n " , " " )
188- . replace ( "/" , "" )
189- . replace ( "\t " , " " )
190- . replace ( "{" , "" )
191- . replace ( "}" , "" )
192- . split ( ' ' )
193- . filter ( |s| s. len ( ) > 0 )
194- . collect :: < Vec < & str > > ( )
195- . join ( " " )
182+ minifier:: css:: minify (
183+ & positions
184+ . chunks ( 2 )
185+ . map ( |x| :: std:: str:: from_utf8 ( & v[ x[ 0 ] ..x[ 1 ] ] ) . unwrap_or ( "" ) )
186+ . collect :: < String > ( )
187+ . trim ( )
188+ . replace ( "\n " , " " )
189+ . replace ( "/" , "" )
190+ . replace ( "\t " , " " )
191+ . replace ( "{" , "" )
192+ . replace ( "}" , "" )
193+ . split ( ' ' )
194+ . filter ( |s| s. len ( ) > 0 )
195+ . collect :: < Vec < & str > > ( )
196+ . join ( " " ) ,
197+ )
198+ . unwrap_or_else ( |_| String :: new ( ) )
196199}
197200
198201fn inner ( v : & [ u8 ] , events : & [ Events ] , pos : & mut usize ) -> FxHashSet < CssPath > {
You can’t perform that action at this time.
0 commit comments