Fix clippy_lints doc-tests
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//!
|
||||
//! For example, the lint would catch
|
||||
//!
|
||||
//! ```
|
||||
//! ```ignore
|
||||
//! while condition() {
|
||||
//! update_condition();
|
||||
//! if x {
|
||||
@@ -16,7 +16,7 @@
|
||||
//!
|
||||
//! And suggest something like this:
|
||||
//!
|
||||
//! ```
|
||||
//! ```ignore
|
||||
//! while condition() {
|
||||
//! update_condition();
|
||||
//! if x {
|
||||
@@ -365,7 +365,7 @@ fn check_and_warn<'a>(ctx: &EarlyContext, expr: &'a ast::Expr) {
|
||||
///
|
||||
/// is transformed to
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// {
|
||||
/// let x = 5;
|
||||
/// ```
|
||||
@@ -388,7 +388,7 @@ pub fn erode_from_back(s: &str) -> String {
|
||||
/// any number of opening braces are eaten, followed by any number of newlines.
|
||||
/// e.g., the string
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// {
|
||||
/// something();
|
||||
/// inside_a_block();
|
||||
@@ -397,7 +397,7 @@ pub fn erode_from_back(s: &str) -> String {
|
||||
///
|
||||
/// is transformed to
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// something();
|
||||
/// inside_a_block();
|
||||
/// }
|
||||
|
||||
@@ -43,7 +43,7 @@ impl LintPass for QuestionMarkPass {
|
||||
impl QuestionMarkPass {
|
||||
/// Check if the given expression on the given context matches the following structure:
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// if option.is_none() {
|
||||
/// return None;
|
||||
/// }
|
||||
|
||||
@@ -612,7 +612,7 @@ pub fn span_lint_and_then<'a, 'tcx: 'a, T: LintContext<'tcx>, F>(
|
||||
/// These suggestions can be parsed by rustfix to allow it to automatically fix your code.
|
||||
/// In the example below, `help` is `"try"` and `sugg` is the suggested replacement `".any(|x| x > 2)"`.
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// error: This `.fold` can be more succinctly expressed as `.any`
|
||||
/// --> $DIR/methods.rs:390:13
|
||||
/// |
|
||||
|
||||
Reference in New Issue
Block a user