Skip to content

Commit adf7d7b

Browse files
committed
Fix lint
1 parent 468aaf9 commit adf7d7b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/language_client.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ impl LanguageClient {
3636
// garbage collected as a result of another modification updating the hash map, while something was holding the lock
3737
pub fn get_client_update_mutex(&self, language_id: LanguageId) -> Result<Arc<Mutex<()>>> {
3838
let map_guard = self.clients_mutex.lock();
39-
let mut map = map_guard.or_else(|err| {
40-
Err(anyhow!(
39+
let mut map = map_guard.map_err(|err| {
40+
anyhow!(
4141
"Failed to lock client creation for languageId {:?}: {:?}",
4242
language_id,
4343
err,
44-
))
44+
)
4545
})?;
4646
if !map.contains_key(&language_id) {
4747
map.insert(language_id.clone(), Arc::new(Mutex::new(())));

src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl<P: AsRef<Path> + std::fmt::Debug> ToUrl for P {
161161
fn to_url(&self) -> Result<Url> {
162162
Url::from_file_path(self)
163163
.or_else(|_| Url::from_str(&self.as_ref().to_string_lossy()))
164-
.or_else(|_| Err(anyhow!("Failed to convert ({:?}) to Url", self)))
164+
.map_err(|_| anyhow!("Failed to convert ({:?}) to Url", self))
165165
}
166166
}
167167

0 commit comments

Comments
 (0)