Skip to content

Commit 55731bb

Browse files
committed
Fix lint error, change scrape-examples.js minify call
1 parent 25323ec commit 55731bb

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/librustdoc/html/render/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
417417
krate: krate.name.to_string(),
418418
css_file_extension: extension_css,
419419
generate_search_filter,
420-
scrape_examples_extension: call_locations.len() > 0,
420+
scrape_examples_extension: !call_locations.is_empty(),
421421
};
422422
let mut issue_tracker_base_url = None;
423423
let mut include_sources = true;

src/librustdoc/html/render/write_shared.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,12 @@ pub(super) fn write_shared(
304304
}
305305

306306
if cx.shared.layout.scrape_examples_extension {
307-
write_minify("scrape-examples.js", static_files::SCRAPE_EXAMPLES_JS, cx, options)?;
307+
cx.write_minify(
308+
SharedResource::Unversioned { name: "scrape-examples.js" },
309+
static_files::SCRAPE_EXAMPLES_JS,
310+
options.enable_minification,
311+
&options.emit,
312+
)?;
308313
}
309314

310315
if let Some(ref css) = cx.shared.layout.css_file_extension {

src/librustdoc/html/static/js/scrape-examples.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global addClass, hasClass, removeClass, onEach */
2+
13
(function () {
24
// Scroll code block to put the given code location in the middle of the viewer
35
function scrollToLoc(elt, loc) {

0 commit comments

Comments
 (0)