aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorGalilée 'Bill' Enguehard <[email protected]>2020-05-22 19:10:37 +0100
committerGalilée 'Bill' Enguehard <[email protected]>2020-05-22 19:10:37 +0100
commit910ac5a21399115ab5a4e1dc423da64fd91e7e15 (patch)
tree0a3f88b7562041b33c4230ab18ac5b1c93c0186a /crates
parent5043c9ce9c9d07263305ef0e560b8ce506593748 (diff)
Fix formatting error when no modpath is present
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_ide/src/display.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide/src/display.rs b/crates/ra_ide/src/display.rs
index 323505ef6..8bb312156 100644
--- a/crates/ra_ide/src/display.rs
+++ b/crates/ra_ide/src/display.rs
@@ -79,14 +79,14 @@ pub(crate) fn rust_code_markup_with_doc(
79 doc: Option<&str>, 79 doc: Option<&str>,
80 mod_path: Option<&str>, 80 mod_path: Option<&str>,
81) -> String { 81) -> String {
82 let mut buf = "".to_owned(); 82 let mut buf = String::new();
83 83
84 if let Some(mod_path) = mod_path { 84 if let Some(mod_path) = mod_path {
85 if !mod_path.is_empty() { 85 if !mod_path.is_empty() {
86 format_to!(buf, "{}\n___\n", mod_path); 86 format_to!(buf, "{}\n___\n\n", mod_path);
87 } 87 }
88 } 88 }
89 format_to!(buf, "```rust\n\n{}\n```", code); 89 format_to!(buf, "```rust\n{}\n```", code);
90 90
91 if let Some(doc) = doc { 91 if let Some(doc) = doc {
92 format_to!(buf, "\n\n{}", doc); 92 format_to!(buf, "\n\n{}", doc);