about summary refs log tree commit diff
path: root/clippy_lints/src/casts
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2023-04-23 13:03:09 +0200
committerPhilipp Krones <hello@philkrones.com>2023-04-23 13:28:56 +0200
commita1b75c5108514504c8382ac70d56f9a2a9aee7c4 (patch)
treecf80402b1e8554c973d6a0f48d158fb40580845f /clippy_lints/src/casts
parentf30fc0a5e2e1d2e816c264354c45a6d7da576107 (diff)
downloadrust-a1b75c5108514504c8382ac70d56f9a2a9aee7c4.tar.gz
rust-a1b75c5108514504c8382ac70d56f9a2a9aee7c4.zip
Merge commit 'a3ed905928a03b6e433d0b429190bf3a847128b3' into clippyup
Diffstat (limited to 'clippy_lints/src/casts')
-rw-r--r--clippy_lints/src/casts/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs
index 362f70d12d1..d74bd57fe45 100644
--- a/clippy_lints/src/casts/mod.rs
+++ b/clippy_lints/src/casts/mod.rs
@@ -506,7 +506,7 @@ declare_clippy_lint! {
 
 declare_clippy_lint! {
     /// ### What it does
-    /// Checks for uses of the `abs()` method that cast the result to unsigned.
+    /// Checks for usage of the `abs()` method that cast the result to unsigned.
     ///
     /// ### Why is this bad?
     /// The `unsigned_abs()` method avoids panic when called on the MIN value.
@@ -625,14 +625,14 @@ declare_clippy_lint! {
     ///
     /// ### Example
     /// ```rust
-    /// let string = String::with_capacity(1);
-    /// let ptr = string.as_ptr() as *mut u8;
+    /// let mut vec = Vec::<u8>::with_capacity(1);
+    /// let ptr = vec.as_ptr() as *mut u8;
     /// unsafe { ptr.write(4) }; // UNDEFINED BEHAVIOUR
     /// ```
     /// Use instead:
     /// ```rust
-    /// let mut string = String::with_capacity(1);
-    /// let ptr = string.as_mut_ptr();
+    /// let mut vec = Vec::<u8>::with_capacity(1);
+    /// let ptr = vec.as_mut_ptr();
     /// unsafe { ptr.write(4) };
     /// ```
     #[clippy::version = "1.66.0"]