nit: move an allocation to happen after a continue, making sure it's

not done for nothing
This commit is contained in:
Alexis (Poliorcetics) Bourget 2022-10-15 18:39:55 +02:00 committed by Michael Davis
parent 5a848344a9
commit 3aea33a415

View file

@ -597,14 +597,14 @@ impl Application {
// trigger textDocument/didOpen for docs that are already open // trigger textDocument/didOpen for docs that are already open
for doc in docs { for doc in docs {
let language_id =
doc.language_id().map(ToOwned::to_owned).unwrap_or_default();
let url = match doc.url() { let url = match doc.url() {
Some(url) => url, Some(url) => url,
None => continue, // skip documents with no path None => continue, // skip documents with no path
}; };
let language_id =
doc.language_id().map(ToOwned::to_owned).unwrap_or_default();
tokio::spawn(language_server.text_document_did_open( tokio::spawn(language_server.text_document_did_open(
url, url,
doc.version(), doc.version(),