From 81b9b2ca85c57c184891d6a1a0fb3e394310c492 Mon Sep 17 00:00:00 2001 From: mcarton Date: Fri, 29 Jul 2016 20:36:33 +0200 Subject: [PATCH] s/```/```rust when relevant It looks better on the wiki/the new documentation page. --- CONTRIBUTING.md | 2 +- clippy_lints/src/collapsible_if.rs | 2 +- clippy_lints/src/entry.rs | 2 +- clippy_lints/src/format.rs | 4 ++-- clippy_lints/src/misc.rs | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5e74cd9ef02..3928adbc949 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,7 @@ contains some questionable code itself! Also before making a pull request, pleas travis build actually checks for this. Also please document your lint with a doc comment akin to the following: -``` +```rust /// **What it does:** Describe what the lint matches. /// /// **Why is this bad?** Write the reason for linting the code. diff --git a/clippy_lints/src/collapsible_if.rs b/clippy_lints/src/collapsible_if.rs index 09d3b89b05e..0ef94cb9d50 100644 --- a/clippy_lints/src/collapsible_if.rs +++ b/clippy_lints/src/collapsible_if.rs @@ -2,7 +2,7 @@ //! //! For example, the lint would catch: //! -//! ``` +//! ```rust //! if x { //! if y { //! println!("Hello world"); diff --git a/clippy_lints/src/entry.rs b/clippy_lints/src/entry.rs index c7afc2d5cd9..b3002b06973 100644 --- a/clippy_lints/src/entry.rs +++ b/clippy_lints/src/entry.rs @@ -11,7 +11,7 @@ use utils::{get_item_name, match_type, paths, snippet, span_lint_and_then, walk_ /// **Why is this bad?** Using `entry` is more efficient. /// /// **Known problems:** Some false negatives, eg.: -/// ``` +/// ```rust /// let k = &key; /// if !m.contains_key(k) { m.insert(k.clone(), v); } /// ``` diff --git a/clippy_lints/src/format.rs b/clippy_lints/src/format.rs index 5ce8420acc0..081ad18321e 100644 --- a/clippy_lints/src/format.rs +++ b/clippy_lints/src/format.rs @@ -65,7 +65,7 @@ impl LateLintPass for Pass { } /// Checks if the expressions matches -/// ``` +/// ```rust /// { static __STATIC_FMTSTR: &[""] = _; __STATIC_FMTSTR } /// ``` fn check_static_str(cx: &LateContext, expr: &Expr) -> bool { @@ -91,7 +91,7 @@ fn check_static_str(cx: &LateContext, expr: &Expr) -> bool { } /// Checks if the expressions matches -/// ``` +/// ```rust /// &match (&42,) { /// (__arg0,) => [::std::fmt::ArgumentV1::new(__arg0, ::std::fmt::Display::fmt)], /// }) diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index 238bb402298..7d54446557b 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -357,7 +357,7 @@ impl LateLintPass for ModuloOne { /// **Known problems:** None /// /// **Example**: -/// ``` +/// ```rust /// match v { /// Some(x) => (), /// y @ _ => (), // easier written as `y`, @@ -399,7 +399,7 @@ impl LateLintPass for PatternPass { /// allowed in the mean time. /// /// **Example**: -/// ``` +/// ```rust /// let _x = 0; /// let y = _x + 1; // Here we are using `_x`, even though it has a leading underscore. /// // We should rename `_x` to `x`