diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5e74cd9ef..3928adbc9 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 09d3b89b0..0ef94cb9d 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 c7afc2d5c..b3002b069 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 5ce8420ac..081ad1832 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 238bb4022..7d5444655 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`