mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
s/``/
``rust when relevant
It looks better on the wiki/the new documentation page.
This commit is contained in:
parent
0fbb0bf77b
commit
81b9b2ca85
@ -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.
|
||||
|
@ -2,7 +2,7 @@
|
||||
//!
|
||||
//! For example, the lint would catch:
|
||||
//!
|
||||
//! ```
|
||||
//! ```rust
|
||||
//! if x {
|
||||
//! if y {
|
||||
//! println!("Hello world");
|
||||
|
@ -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); }
|
||||
/// ```
|
||||
|
@ -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)],
|
||||
/// })
|
||||
|
@ -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`
|
||||
|
Loading…
Reference in New Issue
Block a user