From 8dc68ecdfcc764c7c0dcf5fcedcb51b092d99620 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 14 Jan 2021 18:25:19 +0300 Subject: Introduce more appropriate assertion mechanism rust-analyzer is a long-running program, so we *should* handle assertion failures. See also https://www.sqlite.org/assert.html. --- crates/syntax/src/display.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/syntax/src/display.rs') diff --git a/crates/syntax/src/display.rs b/crates/syntax/src/display.rs index 391647fc6..cd956d950 100644 --- a/crates/syntax/src/display.rs +++ b/crates/syntax/src/display.rs @@ -80,7 +80,7 @@ pub fn macro_label(node: &ast::Macro) -> String { let name = node.name().map(|name| name.syntax().text().to_string()).unwrap_or_default(); match node { ast::Macro::MacroRules(node) => { - let vis = if node.has_atom_attr("macro_export") { "#[macro_export]\n" } else { "" }; + let vis = if node.has_atom_attr("macro_export") { "#[macro_export] " } else { "" }; format!("{}macro_rules! {}", vis, name) } ast::Macro::MacroDef(node) => { -- cgit v1.2.3