Skip to content

Commit 43ac256

Browse files
Add Known problems section
1 parent 565d3fd commit 43ac256

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clippy_lints/src/format_push_string.rs

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

0 commit comments

Comments
 (0)