Skip to content

Commit e1dbafd

Browse files
committed
Auto merge of #12065 - samueltardieu:issue-12063, r=llogiq
Add `.front()` to `get_first` lint description Fix #12063 changelog: none
2 parents a89eb85 + 457ab58 commit e1dbafd

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
@@ -2591,11 +2591,11 @@ declare_clippy_lint! {
25912591
declare_clippy_lint! {
25922592
/// ### What it does
25932593
/// Checks for usage of `x.get(0)` instead of
2594-
/// `x.first()`.
2594+
/// `x.first()` or `x.front()`.
25952595
///
25962596
/// ### Why is this bad?
2597-
/// Using `x.first()` is easier to read and has the same
2598-
/// result.
2597+
/// Using `x.first()` for `Vec`s and slices or `x.front()`
2598+
/// for `VecDeque`s is easier to read and has the same result.
25992599
///
26002600
/// ### Example
26012601
/// ```no_run
@@ -2611,7 +2611,7 @@ declare_clippy_lint! {
26112611
#[clippy::version = "1.63.0"]
26122612
pub GET_FIRST,
26132613
style,
2614-
"Using `x.get(0)` when `x.first()` is simpler"
2614+
"Using `x.get(0)` when `x.first()` or `x.front()` is simpler"
26152615
}
26162616

26172617
declare_clippy_lint! {

0 commit comments

Comments
 (0)