formatting

fix formatting

fixed last formatting issue

Signed-off-by: faldor20 <eli.jambu@yahoo.com>
This commit is contained in:
Eli Dowling 2024-01-25 11:13:19 +10:00 committed by faldor20
parent 987e0c6c4b
commit 84e8e61fa5
No known key found for this signature in database
GPG key ID: F2216079B890CD57
2 changed files with 9 additions and 18 deletions

View file

@ -41,11 +41,7 @@ pub(crate) struct Registry {
impl Registry {
pub async fn get_latest_version(&self, url: &Url) -> Option<i32> {
self.documents
.lock()
.await
.get(url)
.map(|x| x.info.version)
self.documents.lock().await.get(url).map(|x| x.info.version)
}
fn update_document(
@ -54,8 +50,9 @@ impl Registry {
updating_url: &Url,
) {
if &document.doc_info.url == updating_url {
if let Some(a) = documents
.get_mut(updating_url) { a.latest_document.set(document.clone()).unwrap() }
if let Some(a) = documents.get_mut(updating_url) {
a.latest_document.set(document.clone()).unwrap()
}
}
let url = document.url().clone();
@ -148,7 +145,6 @@ impl Registry {
pub async fn diagnostics(&self, url: &Url) -> Vec<Diagnostic> {
let Some(document) = self.latest_document_by_url(url).await else {
return vec![];
};
document.diagnostics()
}

View file

@ -118,9 +118,7 @@ impl RocServerState {
&self.registry
}
async fn close(&self, _fi: Url) {
}
async fn close(&self, _fi: Url) {}
pub async fn change(
&self,
@ -348,15 +346,12 @@ async fn main() {
#[cfg(test)]
mod tests {
use std::{
sync::{Once},
};
use std::sync::Once;
use indoc::indoc;
use expect_test::expect;
use indoc::indoc;
use log::info;
use super::*;
fn completion_resp_to_labels(resp: CompletionResponse) -> Vec<String> {