@@ -7,7 +7,7 @@ use clippy_config::Conf;
7
7
use clippy_utils:: attrs:: is_doc_hidden;
8
8
use clippy_utils:: diagnostics:: { span_lint, span_lint_and_help, span_lint_and_then} ;
9
9
use clippy_utils:: macros:: { is_panic, root_macro_call_first_node} ;
10
- use clippy_utils:: source:: snippet ;
10
+ use clippy_utils:: source:: snippet_opt ;
11
11
use clippy_utils:: ty:: is_type_diagnostic_item;
12
12
use clippy_utils:: visitors:: Visitable ;
13
13
use clippy_utils:: { is_entrypoint_fn, is_trait_impl_item, method_chain_args} ;
@@ -626,11 +626,11 @@ declare_clippy_lint! {
626
626
}
627
627
628
628
declare_clippy_lint ! {
629
- /// Detects doc comment linebreaks that use double spaces to separate lines, instead of back-slash (\ ).
629
+ /// Detects doc comment linebreaks that use double spaces to separate lines, instead of back-slash (`\` ).
630
630
///
631
631
/// ### Why is this bad?
632
632
/// Double spaces, when used as doc comment linebreaks, can be difficult to see, and may
633
- /// accidentally be removed during automatic formatting or manual refactoring. The use of a back-slash (\ )
633
+ /// accidentally be removed during automatic formatting or manual refactoring. The use of a back-slash (`\` )
634
634
/// is clearer in this regard.
635
635
///
636
636
/// ### Example
@@ -909,6 +909,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
909
909
let mut code_level = 0 ;
910
910
let mut blockquote_level = 0 ;
911
911
let mut collected_breaks: Vec < Span > = Vec :: new ( ) ;
912
+ let mut is_first_paragraph = true ;
912
913
913
914
let mut containers = Vec :: new ( ) ;
914
915
@@ -1085,7 +1086,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
1085
1086
1086
1087
if let Some ( span) = fragments. span ( cx, range. clone ( ) )
1087
1088
&& !span. from_expansion ( )
1088
- && let snippet = snippet ( cx, span, ".." )
1089
+ && let Some ( snippet) = snippet_opt ( cx, span)
1089
1090
&& !snippet. trim ( ) . starts_with ( '\\' )
1090
1091
&& event == HardBreak {
1091
1092
collected_breaks. push ( span) ;
0 commit comments