Skip to content

Commit 2997ec5

Browse files
Rename is_real_and_local function into filename_real_and_local
1 parent 2e1f25b commit 2997ec5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: src/librustdoc/html/sources.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct LocalSourcesCollector<'a, 'tcx> {
5050
src_root: &'a Path,
5151
}
5252

53-
fn is_real_and_local(span: clean::Span, sess: &Session) -> Option<RealFileName> {
53+
fn filename_real_and_local(span: clean::Span, sess: &Session) -> Option<RealFileName> {
5454
if span.cnum(sess) == LOCAL_CRATE
5555
&& let FileName::Real(file) = span.filename(sess)
5656
{
@@ -66,7 +66,8 @@ impl LocalSourcesCollector<'_, '_> {
6666
let span = item.span(self.tcx);
6767
let Some(span) = span else { return };
6868
// skip all synthetic "files"
69-
let Some(p) = is_real_and_local(span, sess).and_then(|file| file.into_local_path()) else {
69+
let Some(p) = filename_real_and_local(span, sess).and_then(|file| file.into_local_path())
70+
else {
7071
return;
7172
};
7273
if self.local_sources.contains_key(&*p) {
@@ -132,7 +133,7 @@ impl DocVisitor<'_> for SourceCollector<'_, '_> {
132133
// If we're not rendering sources, there's nothing to do.
133134
// If we're including source files, and we haven't seen this file yet,
134135
// then we need to render it out to the filesystem.
135-
if let Some(filename) = is_real_and_local(span, sess) {
136+
if let Some(filename) = filename_real_and_local(span, sess) {
136137
let span = span.inner();
137138
let pos = sess.source_map().lookup_source_file(span.lo());
138139
let file_span = span.with_lo(pos.start_pos).with_hi(pos.end_position());

0 commit comments

Comments
 (0)