diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-05-14 10:06:21 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-05-14 10:33:48 +0200 |
| commit | dfbc74b08bcbe6ecb8589423186a74c5a0103448 (patch) | |
| tree | 048c0569a530191832941169f8b6775e1014732b /clippy_lints/src/explicit_write.rs | |
| parent | af80c53450d723824bc532c65687da8dd68ece80 (diff) | |
Rustfmt all the things
Diffstat (limited to 'clippy_lints/src/explicit_write.rs')
| -rw-r--r-- | clippy_lints/src/explicit_write.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clippy_lints/src/explicit_write.rs b/clippy_lints/src/explicit_write.rs index 3790b8ef337..11f2770333f 100644 --- a/clippy_lints/src/explicit_write.rs +++ b/clippy_lints/src/explicit_write.rs @@ -1,5 +1,5 @@ -use crate::utils::{is_expn_of, resolve_node, span_lint, span_lint_and_sugg, match_def_path}; use crate::utils::sym; +use crate::utils::{is_expn_of, match_def_path, paths, resolve_node, span_lint, span_lint_and_sugg}; use if_chain::if_chain; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; @@ -42,11 +42,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitWrite { if write_args.len() > 0; if let ExprKind::Call(ref dest_fun, _) = write_args[0].node; if let ExprKind::Path(ref qpath) = dest_fun.node; - if let Some(dest_fun_id) = - resolve_node(cx, qpath, dest_fun.hir_id).opt_def_id(); - if let Some(dest_name) = if match_def_path(cx, dest_fun_id, &[*sym::std, *sym::io, *sym::stdio, *sym::stdout]) { + if let Some(dest_fun_id) = resolve_node(cx, qpath, dest_fun.hir_id).opt_def_id(); + if let Some(dest_name) = if match_def_path(cx, dest_fun_id, &*paths::STDOUT) { Some("stdout") - } else if match_def_path(cx, dest_fun_id, &[*sym::std, *sym::io, *sym::stdio, *sym::stderr]) { + } else if match_def_path(cx, dest_fun_id, &*paths::STDERR) { Some("stderr") } else { None |
