@@ -951,40 +951,15 @@ themePicker.onblur = handleThemeButtonsBlur;
951
951
key : & str ,
952
952
for_search_index : bool ,
953
953
) -> io:: Result < ( Vec < String > , Vec < String > , Vec < String > ) > {
954
- use minifier:: js;
955
-
956
954
let mut ret = Vec :: new ( ) ;
957
955
let mut krates = Vec :: new ( ) ;
958
956
let mut variables = Vec :: new ( ) ;
959
957
960
- let mut krate = krate. to_owned ( ) ;
961
-
962
958
if path. exists ( ) {
963
959
for line in BufReader :: new ( File :: open ( path) ?) . lines ( ) {
964
960
let line = line?;
965
961
if for_search_index && line. starts_with ( "var R" ) {
966
962
variables. push ( line. clone ( ) ) ;
967
- // We need to check if the crate name has been put into a variable as well.
968
- let tokens: js:: Tokens < ' _ > = js:: simple_minify ( & line)
969
- . into_iter ( )
970
- . filter ( js:: clean_token)
971
- . collect :: < Vec < _ > > ( )
972
- . into ( ) ;
973
- let mut pos = 0 ;
974
- while pos < tokens. len ( ) {
975
- if let Some ( ( var_pos, Some ( value_pos) ) ) =
976
- js:: get_variable_name_and_value_positions ( & tokens, pos) {
977
- if let Some ( s) = tokens. 0 [ value_pos] . get_string ( ) {
978
- if & s[ 1 ..s. len ( ) - 1 ] == krate {
979
- if let Some ( var) = tokens[ var_pos] . get_other ( ) {
980
- krate = var. to_owned ( ) ;
981
- break
982
- }
983
- }
984
- }
985
- }
986
- pos += 1 ;
987
- }
988
963
continue ;
989
964
}
990
965
if !line. starts_with ( key) {
@@ -1344,6 +1319,8 @@ fn write_minify_replacer<W: Write>(
1344
1319
f,
1345
1320
"R" ,
1346
1321
Token :: Char ( ReservedChar :: Backline ) ,
1322
+ // This closure prevents crates' name to be aggregated. It allows to not
1323
+ // have to look for crate's name into the strings array.
1347
1324
|tokens, pos| {
1348
1325
pos < 2 ||
1349
1326
!tokens[ pos - 1 ] . is_char( ReservedChar :: OpenBracket ) ||
0 commit comments