about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2023-12-31 14:44:11 +0100
committerSamuel Tardieu <sam@rfc1149.net>2023-12-31 15:38:38 +0100
commit457ab585fc5a5174021bed21c4c0a55deef9676c (patch)
treefe7bc34036709f8b75e8dda7d7cd8f240a29ee4d
parenteca393239515c0a72838eec9477e6689809911c4 (diff)
downloadrust-457ab585fc5a5174021bed21c4c0a55deef9676c.tar.gz
rust-457ab585fc5a5174021bed21c4c0a55deef9676c.zip
Add `.front()` to `get_first` lint description
-rw-r--r--clippy_lints/src/methods/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index 0cde17ef5ad..7f5c82a3e7a 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -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
@@ -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! {