@@ -417,22 +417,19 @@ fn loop_turn(
417417 if Some ( resp. id ) == loop_state. configuration_request_id {
418418 loop_state. configuration_request_id = None ;
419419 if let Some ( err) = resp. error {
420- log:: error!( "failed fetch the server settings: {:?}" , err)
421- } else if resp. result . is_none ( ) {
422- log:: error!( "received empty server settings response from the client" )
423- } else {
424- let new_config =
425- serde_json:: from_value :: < Vec < ServerConfig > > ( resp. result . unwrap ( ) ) ?
426- . first ( )
427- . expect (
428- "The client is expected to always send a non-empty config data" ,
429- )
430- . to_owned ( ) ;
420+ log:: error!( "failed to fetch the server settings: {:?}" , err)
421+ } else if let Some ( result) = resp. result {
422+ let new_config = serde_json:: from_value :: < Vec < ServerConfig > > ( result) ?
423+ . first ( )
424+ . expect ( "The client is expected to always send a non-empty config data" )
425+ . to_owned ( ) ;
431426 world_state. update_configuration (
432427 new_config. lru_capacity ,
433428 get_options ( & new_config, text_document_caps) ,
434429 get_feature_flags ( & new_config, connection) ,
435430 ) ;
431+ } else {
432+ log:: error!( "received empty server settings response from the client" )
436433 }
437434 }
438435 }
@@ -673,7 +670,7 @@ fn on_notification(
673670 ConfigurationParams :: default ( ) ,
674671 ) ;
675672 msg_sender. send ( request. into ( ) ) ?;
676- loop_state. configuration_request_id . replace ( request_id) ;
673+ loop_state. configuration_request_id = Some ( request_id) ;
677674
678675 return Ok ( ( ) ) ;
679676 }
0 commit comments