Skip to content

Commit 457ab58

Browse files
committed
Add .front() to get_first lint description
1 parent eca3932 commit 457ab58

File tree

1 file changed

+4
-4
lines changed
  • clippy_lints/src/methods

1 file changed

+4
-4
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,11 +2590,11 @@ declare_clippy_lint! {
25902590
declare_clippy_lint! {
25912591
/// ### What it does
25922592
/// Checks for usage of `x.get(0)` instead of
2593-
/// `x.first()`.
2593+
/// `x.first()` or `x.front()`.
25942594
///
25952595
/// ### Why is this bad?
2596-
/// Using `x.first()` is easier to read and has the same
2597-
/// result.
2596+
/// Using `x.first()` for `Vec`s and slices or `x.front()`
2597+
/// for `VecDeque`s is easier to read and has the same result.
25982598
///
25992599
/// ### Example
26002600
/// ```no_run
@@ -2610,7 +2610,7 @@ declare_clippy_lint! {
26102610
#[clippy::version = "1.63.0"]
26112611
pub GET_FIRST,
26122612
style,
2613-
"Using `x.get(0)` when `x.first()` is simpler"
2613+
"Using `x.get(0)` when `x.first()` or `x.front()` is simpler"
26142614
}
26152615

26162616
declare_clippy_lint! {

0 commit comments

Comments
 (0)