.get_if_local(def_id)
.and_then(|node| node.body_id())
.into_iter()
- .map(|id| tcx.hir().body(id).params)
- .flatten();
+ .flat_map(|id| tcx.hir().body(id).params)
+ ;
for param in params {
spans.push_span_label(param.span, String::new());
SuggestionText::Remove(plural) => {
Some(format!("remove the extra argument{}", if plural { "s" } else { "" }))
}
- SuggestionText::Swap => Some(format!("swap these arguments")),
- SuggestionText::Reorder => Some(format!("reorder these arguments")),
- SuggestionText::DidYouMean => Some(format!("did you mean")),
+ SuggestionText::Swap => Some("swap these arguments".to_string()),
+ SuggestionText::Reorder => Some("reorder these arguments".to_string()),
+ SuggestionText::DidYouMean => Some("did you mean".to_string()),
};
if let Some(suggestion_text) = suggestion_text {
let source_map = self.sess().source_map();