From e5f87735d3611b45c778e27b99cc4c6880962901 Mon Sep 17 00:00:00 2001 From: "Oleksii (Alexey) Orlenko" Date: Fri, 5 Dec 2025 23:27:21 +0100 Subject: [PATCH] markdown_preview: Remove unnecessary vec allocation (#44238) Instead of allocating a one-element vec on the heap, we can just use an array here (since `Editor::edit` accepts anything that implements `IntoIterator`). I haven't checked if there are more instances that can be simplified, just accidentally stumbled upon this when working on something else in the markdown preview crate. Release Notes: - N/A --- crates/markdown_preview/src/markdown_preview_view.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/markdown_preview/src/markdown_preview_view.rs b/crates/markdown_preview/src/markdown_preview_view.rs index 4126a31379fa74a750a7d111ac71dc180a3bb0ff..df8201dc7a3dad18c279582d668304ce9e1cf77b 100644 --- a/crates/markdown_preview/src/markdown_preview_view.rs +++ b/crates/markdown_preview/src/markdown_preview_view.rs @@ -524,7 +524,7 @@ impl Render for MarkdownPreviewView { if e.checked() { "[x]" } else { "[ ]" }; editor.edit( - vec![( + [( MultiBufferOffset( e.source_range().start, )