about summary refs log tree commit diff
path: root/clippy_lints/src
diff options
context:
space:
mode:
authorJohn Arundel <john@bitfieldconsulting.com>2024-07-07 10:44:27 +0100
committerJohn Arundel <john@bitfieldconsulting.com>2024-07-07 10:44:27 +0100
commitf7050b0c784559a0eacbbfac9f7be95cb81dba66 (patch)
tree7557fc8328a92b49b2235cb7711567a398670e90 /clippy_lints/src
parent625091d2368e3f0f6d0127b27b183d5d855c4d08 (diff)
resolve code review comments
Diffstat (limited to 'clippy_lints/src')
-rw-r--r--clippy_lints/src/await_holding_invalid.rs2
-rw-r--r--clippy_lints/src/casts/mod.rs12
-rw-r--r--clippy_lints/src/casts/ptr_as_ptr.rs2
-rw-r--r--clippy_lints/src/methods/mod.rs3
4 files changed, 9 insertions, 10 deletions
diff --git a/clippy_lints/src/await_holding_invalid.rs b/clippy_lints/src/await_holding_invalid.rs
index dac1f4ed404..1a4dc38e7e9 100644
--- a/clippy_lints/src/await_holding_invalid.rs
+++ b/clippy_lints/src/await_holding_invalid.rs
@@ -15,7 +15,7 @@ declare_clippy_lint! {
     /// `MutexGuard`.
     ///
     /// ### Why is this bad?
-    /// The Mutex types found in [`std::sync`] and
+    /// The Mutex types found in [`std::sync`][https://doc.rust-lang.org/stable/std/sync/] and
     /// [`parking_lot`](https://docs.rs/parking_lot/latest/parking_lot/) are
     /// not designed to operate in an async context across await points.
     ///
diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs
index d8bae3b48bf..7eaa802ecc2 100644
--- a/clippy_lints/src/casts/mod.rs
+++ b/clippy_lints/src/casts/mod.rs
@@ -244,9 +244,9 @@ declare_clippy_lint! {
     ///
     /// ### Why is this bad?
     /// Casting a function pointer to anything other than `usize`/`isize` is
-    /// not portable across architectures. It either loses bits if the target
-    /// type is too small, or creates extra bits that waste space and bloat the
-    /// resulting binary.
+    /// not portable across architectures. If the target type is too small the
+    /// address would be truncated, and target types larger than `usize` are
+    /// unnecessary.
     ///
     /// Casting to `isize` also doesn't make sense, since addresses are never
     /// signed.
@@ -373,7 +373,7 @@ declare_clippy_lint! {
 
 declare_clippy_lint! {
     /// ### What it does
-    /// Checks for `as` casts on a raw pointer that don't change its
+    /// Checks for `as` casts between raw pointers that don't change their
     /// mutability, namely `*const T` to `*const U` and `*mut T` to `*mut U`.
     ///
     /// ### Why is this bad?
@@ -398,12 +398,12 @@ declare_clippy_lint! {
     #[clippy::version = "1.51.0"]
     pub PTR_AS_PTR,
     pedantic,
-    "casting using `as` on a raw pointer that doesn't change its mutability, where `pointer::cast` could take the place of `as`"
+    "casting using `as` between raw pointers that doesn't change their constness, where `pointer::cast` could take the place of `as`"
 }
 
 declare_clippy_lint! {
     /// ### What it does
-    /// Checks for `as` casts on a raw pointer that change its constness, namely `*const T` to
+    /// Checks for `as` casts between raw pointers that change their constness, namely `*const T` to
     /// `*mut T` and `*mut T` to `*const T`.
     ///
     /// ### Why is this bad?
diff --git a/clippy_lints/src/casts/ptr_as_ptr.rs b/clippy_lints/src/casts/ptr_as_ptr.rs
index 2c168405ee2..86c5f6b9f0b 100644
--- a/clippy_lints/src/casts/ptr_as_ptr.rs
+++ b/clippy_lints/src/casts/ptr_as_ptr.rs
@@ -92,7 +92,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: &Msrv) {
             cx,
             PTR_AS_PTR,
             expr.span,
-            "`as` casting between raw pointers without changing its mutability",
+            "`as` casting between raw pointers without changing their constness",
             help,
             final_suggestion,
             app,
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index b8b24fe92ee..c29f81bf0fb 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -632,8 +632,7 @@ declare_clippy_lint! {
     /// or `_.or_else(|x| Err(y))`.
     ///
     /// ### Why is this bad?
-    /// This can be written more concisely as `_.map(|x| y)` or `_.map_err(|x|
-    /// y)`.
+    /// This can be written more concisely as `_.map(|x| y)` or `_.map_err(|x| y)`.
     ///
     /// ### Example
     /// ```no_run