Skip to content

Commit

Permalink
Hide variables in doc-test
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkuu committed Sep 4, 2019
1 parent 45fde0f commit c6fb9c8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,19 +992,19 @@ declare_clippy_lint! {
/// **Example:**
///
/// ```rust
/// let x: u32 = 100;
///
/// let add = x.checked_add(3).unwrap_or(u32::max_value());
/// let sub = x.checked_sub(3).unwrap_or(u32::min_value());
/// # let y: u32 = 0;
/// # let x: u32 = 100;
/// let add = x.checked_add(y).unwrap_or(u32::max_value());
/// let sub = x.checked_sub(y).unwrap_or(u32::min_value());
/// ```
///
/// can be written using dedicated methods for saturating addition/subtraction as:
///
/// ```rust
/// let x: u32 = 100;
///
/// let add = x.saturating_add(3);
/// let sub = x.saturating_sub(3);
/// # let y: u32 = 0;
/// # let x: u32 = 100;
/// let add = x.saturating_add(y);
/// let sub = x.saturating_sub(y);
/// ```
pub MANUAL_SATURATING_ARITHMETIC,
style,
Expand Down

0 comments on commit c6fb9c8

Please sign in to comment.