From 222086d62b2c22e59eab82f03f4d08e3cb9bd6ae Mon Sep 17 00:00:00 2001 From: mcarton Date: Sat, 20 Feb 2016 17:33:53 +0100 Subject: [PATCH] Remove all use of `format!("string literal")` --- src/loops.rs | 4 ++-- src/methods.rs | 2 +- src/types.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/loops.rs b/src/loops.rs index 2754f743caa9..9e5745950dd7 100644 --- a/src/loops.rs +++ b/src/loops.rs @@ -317,8 +317,8 @@ impl LateLintPass for LoopsPass { span_lint(cx, UNUSED_COLLECT, expr.span, - &format!("you are collect()ing an iterator and throwing away the result. Consider \ - using an explicit for loop to exhaust the iterator")); + &"you are collect()ing an iterator and throwing away the result. \ + Consider using an explicit for loop to exhaust the iterator"); } } } diff --git a/src/methods.rs b/src/methods.rs index 39f69f63d7b6..f776d5890b79 100644 --- a/src/methods.rs +++ b/src/methods.rs @@ -589,7 +589,7 @@ fn lint_extend(cx: &LateContext, expr: &Expr, args: &MethodArgs) { span_lint(cx, EXTEND_FROM_SLICE, expr.span, - &format!("use of `extend` to extend a Vec by a slice")) + &"use of `extend` to extend a Vec by a slice") .span_suggestion(expr.span, "try this", format!("{}.extend_from_slice({}{})", diff --git a/src/types.rs b/src/types.rs index 7cfcc76193d4..7521bc48046e 100644 --- a/src/types.rs +++ b/src/types.rs @@ -491,12 +491,12 @@ fn check_type(cx: &LateContext, ty: &Ty) { visitor.visit_ty(ty); visitor.score }; - // println!("{:?} --> {}", ty, score); + if score > 250 { span_lint(cx, TYPE_COMPLEXITY, ty.span, - &format!("very complex type used. Consider factoring parts into `type` definitions")); + &"very complex type used. Consider factoring parts into `type` definitions"); } }