Skip to content

Commit

Permalink
Rollup merge of #118986 - GuillaumeGomez:simplify-js-inline, r=notriddle
Browse files Browse the repository at this point in the history
Simplify JS code a little bit

As mentioned, JS code can be simplified a little bit.

r? ``@notriddle``
  • Loading branch information
matthiaskrgr authored Dec 15, 2023
2 parents 39b6f45 + 028a313 commit b377bab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/html/render/write_shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ pub(super) fn write_shared(
v.push_str(
r#"\
]'));
if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
if (typeof exports !== 'undefined') exports.searchIndex = searchIndex;
else if (window.initSearch) window.initSearch(searchIndex);
"#,
);
Ok(v.into_bytes())
Expand Down

0 comments on commit b377bab

Please sign in to comment.