Skip to content

Add .front() to get_first lint description #12065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2590,11 +2590,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 @@ -2610,7 +2610,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