File tree Expand file tree Collapse file tree 3 files changed +3
-16
lines changed
Expand file tree Collapse file tree 3 files changed +3
-16
lines changed Original file line number Diff line number Diff line change 1- use super :: types:: OptionDeref ;
21use super :: * ;
32use crate :: language_client:: LanguageClient ;
43use crate :: lsp:: notification:: Notification ;
@@ -8,7 +7,7 @@ impl LanguageClient {
87 pub fn handle_call ( & self , msg : Call ) -> Fallible < ( ) > {
98 match msg {
109 Call :: MethodCall ( lang_id, method_call) => {
11- let result = self . handle_method_call ( OptionDeref :: as_deref ( & lang_id ) , & method_call) ;
10+ let result = self . handle_method_call ( lang_id . as_deref ( ) , & method_call) ;
1211 if let Err ( ref err) = result {
1312 if err. find_root_cause ( ) . downcast_ref :: < LCError > ( ) . is_none ( ) {
1413 error ! (
@@ -23,8 +22,7 @@ impl LanguageClient {
2322 . output ( method_call. id . to_int ( ) ?, result) ?;
2423 }
2524 Call :: Notification ( lang_id, notification) => {
26- let result =
27- self . handle_notification ( OptionDeref :: as_deref ( & lang_id) , & notification) ;
25+ let result = self . handle_notification ( lang_id. as_deref ( ) , & notification) ;
2826 if let Err ( ref err) = result {
2927 if err. downcast_ref :: < LCError > ( ) . is_none ( ) {
3028 error ! (
Original file line number Diff line number Diff line change @@ -956,16 +956,6 @@ impl Default for TextDocumentItemMetadata {
956956 }
957957}
958958
959- pub trait OptionDeref < T : Deref > {
960- fn as_deref ( & self ) -> Option < & T :: Target > ;
961- }
962-
963- impl < T : Deref > OptionDeref < T > for Option < T > {
964- fn as_deref ( & self ) -> Option < & T :: Target > {
965- self . as_ref ( ) . map ( Deref :: deref)
966- }
967- }
968-
969959pub trait ToLSP < T > {
970960 fn to_lsp ( self ) -> Fallible < T > ;
971961}
Original file line number Diff line number Diff line change 1- use super :: types:: OptionDeref ;
21use super :: * ;
32use crate :: rpcclient:: RpcClient ;
43use crate :: sign:: Sign ;
@@ -149,7 +148,7 @@ impl Vim {
149148
150149 pub fn edit ( & self , goto_cmd : & Option < String > , path : impl AsRef < Path > ) -> Fallible < ( ) > {
151150 let path = path. as_ref ( ) . to_string_lossy ( ) ;
152- let goto = OptionDeref :: as_deref ( goto_cmd ) . unwrap_or ( "edit" ) ;
151+ let goto = goto_cmd . as_deref ( ) . unwrap_or ( "edit" ) ;
153152 self . rpcclient . notify ( "s:Edit" , json ! ( [ goto, path] ) ) ?;
154153 Ok ( ( ) )
155154 }
You can’t perform that action at this time.
0 commit comments