Skip to content

Commit 910ac5a

Browse files
committed
Fix formatting error when no modpath is present
1 parent 5043c9c commit 910ac5a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/ra_ide/src/display.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ pub(crate) fn rust_code_markup_with_doc(
7979
doc: Option<&str>,
8080
mod_path: Option<&str>,
8181
) -> String {
82-
let mut buf = "".to_owned();
82+
let mut buf = String::new();
8383

8484
if let Some(mod_path) = mod_path {
8585
if !mod_path.is_empty() {
86-
format_to!(buf, "{}\n___\n", mod_path);
86+
format_to!(buf, "{}\n___\n\n", mod_path);
8787
}
8888
}
89-
format_to!(buf, "```rust\n\n{}\n```", code);
89+
format_to!(buf, "```rust\n{}\n```", code);
9090

9191
if let Some(doc) = doc {
9292
format_to!(buf, "\n\n{}", doc);

0 commit comments

Comments
 (0)