mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
formatting
fix formatting fixed last formatting issue Signed-off-by: faldor20 <eli.jambu@yahoo.com>
This commit is contained in:
parent
987e0c6c4b
commit
84e8e61fa5
2 changed files with 9 additions and 18 deletions
|
@ -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();
|
||||
|
@ -146,9 +143,8 @@ impl Registry {
|
|||
}
|
||||
|
||||
pub async fn diagnostics(&self, url: &Url) -> Vec<Diagnostic> {
|
||||
let Some( document) = self.latest_document_by_url(url).await else {
|
||||
let Some(document) = self.latest_document_by_url(url).await else {
|
||||
return vec![];
|
||||
|
||||
};
|
||||
document.diagnostics()
|
||||
}
|
||||
|
|
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue