@@ -5,7 +5,7 @@ use clippy_config::Conf;
5
5
use clippy_utils:: attrs:: is_doc_hidden;
6
6
use clippy_utils:: diagnostics:: { span_lint, span_lint_and_help} ;
7
7
use clippy_utils:: macros:: { is_panic, root_macro_call_first_node} ;
8
- use clippy_utils:: source:: snippet ;
8
+ use clippy_utils:: source:: snippet_opt ;
9
9
use clippy_utils:: ty:: is_type_diagnostic_item;
10
10
use clippy_utils:: visitors:: Visitable ;
11
11
use clippy_utils:: { is_entrypoint_fn, is_trait_impl_item, method_chain_args} ;
@@ -535,11 +535,11 @@ declare_clippy_lint! {
535
535
}
536
536
537
537
declare_clippy_lint ! {
538
- /// Detects doc comment linebreaks that use double spaces to separate lines, instead of back-slash (\ ).
538
+ /// Detects doc comment linebreaks that use double spaces to separate lines, instead of back-slash (`\` ).
539
539
///
540
540
/// ### Why is this bad?
541
541
/// Double spaces, when used as doc comment linebreaks, can be difficult to see, and may
542
- /// accidentally be removed during automatic formatting or manual refactoring. The use of a back-slash (\ )
542
+ /// accidentally be removed during automatic formatting or manual refactoring. The use of a back-slash (`\` )
543
543
/// is clearer in this regard.
544
544
///
545
545
/// ### Example
@@ -814,6 +814,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
814
814
let mut code_level = 0 ;
815
815
let mut blockquote_level = 0 ;
816
816
let mut collected_breaks: Vec < Span > = Vec :: new ( ) ;
817
+ let mut is_first_paragraph = true ;
817
818
818
819
let mut containers = Vec :: new ( ) ;
819
820
@@ -934,7 +935,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
934
935
935
936
if let Some ( span) = fragments. span ( cx, range. clone ( ) )
936
937
&& !span. from_expansion ( )
937
- && let snippet = snippet ( cx, span, ".." )
938
+ && let Some ( snippet) = snippet_opt ( cx, span)
938
939
&& !snippet. trim ( ) . starts_with ( '\\' )
939
940
&& event == HardBreak {
940
941
collected_breaks. push ( span) ;
0 commit comments