diff options
Diffstat (limited to 'crates/gen_lsp_server/src/msg.rs')
-rw-r--r-- | crates/gen_lsp_server/src/msg.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/gen_lsp_server/src/msg.rs b/crates/gen_lsp_server/src/msg.rs index 42241194d..7fcac6f6d 100644 --- a/crates/gen_lsp_server/src/msg.rs +++ b/crates/gen_lsp_server/src/msg.rs | |||
@@ -88,7 +88,7 @@ impl RawMessage { | |||
88 | } | 88 | } |
89 | 89 | ||
90 | impl RawRequest { | 90 | impl RawRequest { |
91 | pub fn new<R>(id: u64, params: R::Params) -> RawRequest | 91 | pub fn new<R>(id: u64, params: &R::Params) -> RawRequest |
92 | where | 92 | where |
93 | R: Request, | 93 | R: Request, |
94 | R::Params: Serialize, | 94 | R::Params: Serialize, |
@@ -96,7 +96,7 @@ impl RawRequest { | |||
96 | RawRequest { | 96 | RawRequest { |
97 | id: id, | 97 | id: id, |
98 | method: R::METHOD.to_string(), | 98 | method: R::METHOD.to_string(), |
99 | params: to_value(¶ms).unwrap(), | 99 | params: to_value(params).unwrap(), |
100 | } | 100 | } |
101 | } | 101 | } |
102 | pub fn cast<R>(self) -> ::std::result::Result<(u64, R::Params), RawRequest> | 102 | pub fn cast<R>(self) -> ::std::result::Result<(u64, R::Params), RawRequest> |
@@ -114,7 +114,7 @@ impl RawRequest { | |||
114 | } | 114 | } |
115 | 115 | ||
116 | impl RawResponse { | 116 | impl RawResponse { |
117 | pub fn ok<R>(id: u64, result: R::Result) -> RawResponse | 117 | pub fn ok<R>(id: u64, result: &R::Result) -> RawResponse |
118 | where R: Request, | 118 | where R: Request, |
119 | R::Result: Serialize, | 119 | R::Result: Serialize, |
120 | { | 120 | { |
@@ -135,14 +135,14 @@ impl RawResponse { | |||
135 | } | 135 | } |
136 | 136 | ||
137 | impl RawNotification { | 137 | impl RawNotification { |
138 | pub fn new<N>(params: N::Params) -> RawNotification | 138 | pub fn new<N>(params: &N::Params) -> RawNotification |
139 | where | 139 | where |
140 | N: Notification, | 140 | N: Notification, |
141 | N::Params: Serialize, | 141 | N::Params: Serialize, |
142 | { | 142 | { |
143 | RawNotification { | 143 | RawNotification { |
144 | method: N::METHOD.to_string(), | 144 | method: N::METHOD.to_string(), |
145 | params: to_value(¶ms).unwrap(), | 145 | params: to_value(params).unwrap(), |
146 | } | 146 | } |
147 | } | 147 | } |
148 | pub fn cast<N>(self) -> ::std::result::Result<N::Params, RawNotification> | 148 | pub fn cast<N>(self) -> ::std::result::Result<N::Params, RawNotification> |