Skip to content

Commit 5dfbc03

Browse files
Rename DocContext::is_json into DocContext::is_json_output
1 parent 0eff07e commit 5dfbc03

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/librustdoc/clean/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2907,7 +2907,7 @@ fn clean_extern_crate<'tcx>(
29072907
None => false,
29082908
}
29092909
})
2910-
&& !cx.is_json();
2910+
&& !cx.is_json_output();
29112911

29122912
let krate_owner_def_id = krate.owner_id.def_id;
29132913
if please_inline {
@@ -3000,7 +3000,7 @@ fn clean_use_statement_inner<'tcx>(
30003000
// forcefully don't inline if this is not public or if the
30013001
// #[doc(no_inline)] attribute is present.
30023002
// Don't inline doc(hidden) imports so they can be stripped at a later stage.
3003-
let mut denied = cx.is_json()
3003+
let mut denied = cx.is_json_output()
30043004
|| !(visibility.is_public()
30053005
|| (cx.render_options.document_private && is_visible_from_parent_mod))
30063006
|| pub_underscore

src/librustdoc/core.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ impl<'tcx> DocContext<'tcx> {
124124

125125
/// Returns `true` if the JSON output format is enabled for generating the crate content.
126126
///
127-
/// If another option like `--show-coverage` is enabled, it will return false.
128-
pub(crate) fn is_json(&self) -> bool {
127+
/// If another option like `--show-coverage` is enabled, it will return `false`.
128+
pub(crate) fn is_json_output(&self) -> bool {
129129
self.output_format.is_json() && !self.show_coverage
130130
}
131131
}

src/librustdoc/passes/strip_hidden.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub(crate) const STRIP_HIDDEN: Pass = Pass {
2323
/// Strip items marked `#[doc(hidden)]`
2424
pub(crate) fn strip_hidden(krate: clean::Crate, cx: &mut DocContext<'_>) -> clean::Crate {
2525
let mut retained = ItemIdSet::default();
26-
let is_json_output = cx.is_json();
26+
let is_json_output = cx.is_json_output();
2727

2828
// strip all #[doc(hidden)] items
2929
let krate = {

src/librustdoc/passes/strip_priv_imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) const STRIP_PRIV_IMPORTS: Pass = Pass {
1313
};
1414

1515
pub(crate) fn strip_priv_imports(krate: clean::Crate, cx: &mut DocContext<'_>) -> clean::Crate {
16-
let is_json_output = cx.is_json();
16+
let is_json_output = cx.is_json_output();
1717
ImportStripper {
1818
tcx: cx.tcx,
1919
is_json_output,

src/librustdoc/passes/strip_private.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub(crate) const STRIP_PRIVATE: Pass = Pass {
1818
pub(crate) fn strip_private(mut krate: clean::Crate, cx: &mut DocContext<'_>) -> clean::Crate {
1919
// This stripper collects all *retained* nodes.
2020
let mut retained = ItemIdSet::default();
21-
let is_json_output = cx.is_json();
21+
let is_json_output = cx.is_json_output();
2222

2323
// strip all private items
2424
{

src/librustdoc/visit_ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
235235
return false;
236236
}
237237

238-
if self.cx.is_json() {
238+
if self.cx.is_json_output() {
239239
return false;
240240
}
241241

0 commit comments

Comments
 (0)