]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/strlen_on_c_strings.rs
Auto merge of #7794 - ThibsG:FieldReassignDefault6312, r=llogiq
[rust.git] / clippy_lints / src / strlen_on_c_strings.rs
index 2ccf3a3796d512379b7b6f9f067747384c3bf9d1..516fa3d95b4282cad0e8f803ec1209b2f3a03c7c 100644 (file)
 use rustc_span::symbol::{sym, Symbol};
 
 declare_clippy_lint! {
-    /// **What it does:** Checks for usage of `libc::strlen` on a `CString` or `CStr` value,
+    /// ### What it does
+    /// Checks for usage of `libc::strlen` on a `CString` or `CStr` value,
     /// and suggest calling `as_bytes().len()` or `to_bytes().len()` respectively instead.
     ///
-    /// **Why is this bad?** This avoids calling an unsafe `libc` function.
+    /// ### Why is this bad?
+    /// This avoids calling an unsafe `libc` function.
     /// Currently, it also avoids calculating the length.
     ///
-    /// **Known problems:** None.
-    ///
-    /// **Example:**
-    ///
+    /// ### Example
     /// ```rust, ignore
     /// use std::ffi::CString;
     /// let cstring = CString::new("foo").expect("CString::new failed");