File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,12 @@ impl LanguageClient {
36
36
// garbage collected as a result of another modification updating the hash map, while something was holding the lock
37
37
pub fn get_client_update_mutex ( & self , language_id : LanguageId ) -> Result < Arc < Mutex < ( ) > > > {
38
38
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 ! (
41
41
"Failed to lock client creation for languageId {:?}: {:?}" ,
42
42
language_id,
43
43
err,
44
- ) )
44
+ )
45
45
} ) ?;
46
46
if !map. contains_key ( & language_id) {
47
47
map. insert ( language_id. clone ( ) , Arc :: new ( Mutex :: new ( ( ) ) ) ) ;
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ impl<P: AsRef<Path> + std::fmt::Debug> ToUrl for P {
161
161
fn to_url ( & self ) -> Result < Url > {
162
162
Url :: from_file_path ( self )
163
163
. 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 ) )
165
165
}
166
166
}
167
167
You can’t perform that action at this time.
0 commit comments