Skip to content

Commit

Permalink
Auto merge of rust-lang#12065 - samueltardieu:issue-12063, r=llogiq
Browse files Browse the repository at this point in the history
Add `.front()` to `get_first` lint description

Fix rust-lang#12063

changelog: none
  • Loading branch information
bors committed Dec 31, 2023
2 parents a89eb85 + 457ab58 commit e1dbafd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2591,11 +2591,11 @@ declare_clippy_lint! {
declare_clippy_lint! {
/// ### What it does
/// Checks for usage of `x.get(0)` instead of
/// `x.first()`.
/// `x.first()` or `x.front()`.
///
/// ### Why is this bad?
/// Using `x.first()` is easier to read and has the same
/// result.
/// Using `x.first()` for `Vec`s and slices or `x.front()`
/// for `VecDeque`s is easier to read and has the same result.
///
/// ### Example
/// ```no_run
Expand All @@ -2611,7 +2611,7 @@ declare_clippy_lint! {
#[clippy::version = "1.63.0"]
pub GET_FIRST,
style,
"Using `x.get(0)` when `x.first()` is simpler"
"Using `x.get(0)` when `x.first()` or `x.front()` is simpler"
}

declare_clippy_lint! {
Expand Down

0 comments on commit e1dbafd

Please sign in to comment.