From aa2c586e36d8d214c4cc625c9c3a791736ead4c1 Mon Sep 17 00:00:00 2001 From: Chris Wong <lambda.fairy@gmail.com> Date: Mon, 6 Feb 2017 15:55:29 +1300 Subject: [PATCH] Correct `maud::DOCTYPE_HTML` to `maud::DOCTYPE` Closes #69 (nice) --- .../src/lints/{doctype_html.rs => doctype.rs} | 16 ++++++++-------- maud_macros/src/lints/mod.rs | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) rename maud_macros/src/lints/{doctype_html.rs => doctype.rs} (74%) diff --git a/maud_macros/src/lints/doctype_html.rs b/maud_macros/src/lints/doctype.rs similarity index 74% rename from maud_macros/src/lints/doctype_html.rs rename to maud_macros/src/lints/doctype.rs index 1bf4585..e61ccb0 100644 --- a/maud_macros/src/lints/doctype_html.rs +++ b/maud_macros/src/lints/doctype.rs @@ -5,20 +5,20 @@ use super::util::match_def_path; use syntax::ast::LitKind; declare_lint! { - pub MAUD_DOCTYPE_HTML, + pub MAUD_DOCTYPE, Warn, - "suggest using the maud::DOCTYPE_HTML constant" + "suggest using the maud::DOCTYPE constant" } -pub struct DoctypeHtml; +pub struct Doctype; -impl LintPass for DoctypeHtml { +impl LintPass for Doctype { fn get_lints(&self) -> LintArray { - lint_array![MAUD_DOCTYPE_HTML] + lint_array![MAUD_DOCTYPE] } } -impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DoctypeHtml { +impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Doctype { fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) { if_chain! { // It's a function call... @@ -33,8 +33,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DoctypeHtml { let def_id = cx.tables.qpath_def(qpath, path_expr.id).def_id(); if match_def_path(cx, def_id, &["maud", "PreEscaped", "{{constructor}}"]); then { - cx.struct_span_lint(MAUD_DOCTYPE_HTML, expr.span, - "use `maud::DOCTYPE_HTML` instead").emit(); + cx.struct_span_lint(MAUD_DOCTYPE, expr.span, + "use `maud::DOCTYPE` instead").emit(); } } } diff --git a/maud_macros/src/lints/mod.rs b/maud_macros/src/lints/mod.rs index c2409d0..37b5acd 100644 --- a/maud_macros/src/lints/mod.rs +++ b/maud_macros/src/lints/mod.rs @@ -3,12 +3,12 @@ use rustc_plugin::Registry; #[macro_use] mod util; -pub mod doctype_html; +mod doctype; pub fn register_lints(reg: &mut Registry) { - reg.register_late_lint_pass(Box::new(doctype_html::DoctypeHtml)); + reg.register_late_lint_pass(Box::new(doctype::Doctype)); reg.register_lint_group("maud", vec![ - doctype_html::MAUD_DOCTYPE_HTML, + doctype::MAUD_DOCTYPE, ]); }