From d77ccdc33870e89c7fba9a55aea876f14754b94d Mon Sep 17 00:00:00 2001 From: mcarton Date: Sun, 21 Feb 2016 13:21:04 +0100 Subject: [PATCH] Fix `USELESS_FORMAT` wiki --- src/format.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/format.rs b/src/format.rs index 901cd3f7a..e161d6fce 100644 --- a/src/format.rs +++ b/src/format.rs @@ -5,15 +5,16 @@ use syntax::ast::LitKind; use utils::{DISPLAY_FMT_METHOD_PATH, FMT_ARGUMENTS_NEWV1_PATH}; use utils::{is_expn_of, match_path, span_lint}; -/// **What it does:** This lints about use of `format!("string literal with no argument")`. +/// **What it does:** This lints about use of `format!("string literal with no argument")` and +/// `format!("{}", foo)`. /// /// **Why is this bad?** There is no point of doing that. If you want a `String` you can use -/// `to_owned` on the string literal. The even worse `&format!("foo")` is often encountered in the -/// wild. +/// `to_owned` on the string literal or expression. The even worse `&format!("foo")` is often +/// encountered in the wild. /// /// **Known problems:** None. /// -/// **Example:** `format!("foo")` +/// **Examples:** `format!("foo")` and `format!("{}", foo)` declare_lint! { pub USELESS_FORMAT, Warn,