Add Known problems section

This commit is contained in:
Victor Nordam Suadicani 2022-07-14 13:26:56 +02:00
parent 565d3fd67d
commit 43ac256cd1

View file

@ -14,6 +14,12 @@ declare_clippy_lint! {
/// ### Why is this bad? /// ### Why is this bad?
/// Introduces an extra, avoidable heap allocation. /// Introduces an extra, avoidable heap allocation.
/// ///
/// ### Known problems
/// `format!` returns a `String` but `write!` returns a `Result`.
/// Thus you are forced to ignore the `Err` variant to achieve the same API.
///
/// While using `write!` in the suggested way should never fail, this isn't necessarily clear to the programmer.
///
/// ### Example /// ### Example
/// ```rust /// ```rust
/// let mut s = String::new(); /// let mut s = String::new();