aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-20 17:06:22 +0100
committerAleksey Kladov <[email protected]>2019-08-20 17:53:05 +0100
commit188c9967c0d0b6ab9acef5e879b5bbaf1a5035ed (patch)
tree89f41cc3674bf38db912a3d0a68a834da9fdc4d7 /crates/ra_lsp_server
parent4753409f86bf21b8d0ba7bd83918aa951921c97c (diff)
Drop unnecessary `&'_` from impls
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r--crates/ra_lsp_server/src/conv.rs40
1 files changed, 20 insertions, 20 deletions
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs
index 1a70ec3a2..818fa6d61 100644
--- a/crates/ra_lsp_server/src/conv.rs
+++ b/crates/ra_lsp_server/src/conv.rs
@@ -88,7 +88,7 @@ impl Conv for Severity {
88 } 88 }
89} 89}
90 90
91impl ConvWith<(&'_ LineIndex, LineEndings)> for CompletionItem { 91impl ConvWith<(&LineIndex, LineEndings)> for CompletionItem {
92 type Output = ::lsp_types::CompletionItem; 92 type Output = ::lsp_types::CompletionItem;
93 93
94 fn conv_with(self, ctx: (&LineIndex, LineEndings)) -> ::lsp_types::CompletionItem { 94 fn conv_with(self, ctx: (&LineIndex, LineEndings)) -> ::lsp_types::CompletionItem {
@@ -136,7 +136,7 @@ impl ConvWith<(&'_ LineIndex, LineEndings)> for CompletionItem {
136 } 136 }
137} 137}
138 138
139impl ConvWith<&'_ LineIndex> for Position { 139impl ConvWith<&LineIndex> for Position {
140 type Output = TextUnit; 140 type Output = TextUnit;
141 141
142 fn conv_with(self, line_index: &LineIndex) -> TextUnit { 142 fn conv_with(self, line_index: &LineIndex) -> TextUnit {
@@ -145,7 +145,7 @@ impl ConvWith<&'_ LineIndex> for Position {
145 } 145 }
146} 146}
147 147
148impl ConvWith<&'_ LineIndex> for TextUnit { 148impl ConvWith<&LineIndex> for TextUnit {
149 type Output = Position; 149 type Output = Position;
150 150
151 fn conv_with(self, line_index: &LineIndex) -> Position { 151 fn conv_with(self, line_index: &LineIndex) -> Position {
@@ -154,7 +154,7 @@ impl ConvWith<&'_ LineIndex> for TextUnit {
154 } 154 }
155} 155}
156 156
157impl ConvWith<&'_ LineIndex> for TextRange { 157impl ConvWith<&LineIndex> for TextRange {
158 type Output = Range; 158 type Output = Range;
159 159
160 fn conv_with(self, line_index: &LineIndex) -> Range { 160 fn conv_with(self, line_index: &LineIndex) -> Range {
@@ -162,7 +162,7 @@ impl ConvWith<&'_ LineIndex> for TextRange {
162 } 162 }
163} 163}
164 164
165impl ConvWith<&'_ LineIndex> for Range { 165impl ConvWith<&LineIndex> for Range {
166 type Output = TextRange; 166 type Output = TextRange;
167 167
168 fn conv_with(self, line_index: &LineIndex) -> TextRange { 168 fn conv_with(self, line_index: &LineIndex) -> TextRange {
@@ -202,7 +202,7 @@ impl Conv for ra_ide_api::FunctionSignature {
202 } 202 }
203} 203}
204 204
205impl ConvWith<(&'_ LineIndex, LineEndings)> for TextEdit { 205impl ConvWith<(&LineIndex, LineEndings)> for TextEdit {
206 type Output = Vec<lsp_types::TextEdit>; 206 type Output = Vec<lsp_types::TextEdit>;
207 207
208 fn conv_with(self, ctx: (&LineIndex, LineEndings)) -> Vec<lsp_types::TextEdit> { 208 fn conv_with(self, ctx: (&LineIndex, LineEndings)) -> Vec<lsp_types::TextEdit> {
@@ -210,7 +210,7 @@ impl ConvWith<(&'_ LineIndex, LineEndings)> for TextEdit {
210 } 210 }
211} 211}
212 212
213impl ConvWith<(&'_ LineIndex, LineEndings)> for &'_ AtomTextEdit { 213impl ConvWith<(&LineIndex, LineEndings)> for &AtomTextEdit {
214 type Output = lsp_types::TextEdit; 214 type Output = lsp_types::TextEdit;
215 215
216 fn conv_with( 216 fn conv_with(
@@ -234,42 +234,42 @@ impl<T: ConvWith<CTX>, CTX> ConvWith<CTX> for Option<T> {
234 } 234 }
235} 235}
236 236
237impl TryConvWith<&'_ WorldSnapshot> for &'_ Url { 237impl TryConvWith<&WorldSnapshot> for &Url {
238 type Output = FileId; 238 type Output = FileId;
239 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileId> { 239 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileId> {
240 world.uri_to_file_id(self) 240 world.uri_to_file_id(self)
241 } 241 }
242} 242}
243 243
244impl TryConvWith<&'_ WorldSnapshot> for FileId { 244impl TryConvWith<&WorldSnapshot> for FileId {
245 type Output = Url; 245 type Output = Url;
246 fn try_conv_with(self, world: &WorldSnapshot) -> Result<Url> { 246 fn try_conv_with(self, world: &WorldSnapshot) -> Result<Url> {
247 world.file_id_to_uri(self) 247 world.file_id_to_uri(self)
248 } 248 }
249} 249}
250 250
251impl TryConvWith<&'_ WorldSnapshot> for &'_ TextDocumentItem { 251impl TryConvWith<&WorldSnapshot> for &TextDocumentItem {
252 type Output = FileId; 252 type Output = FileId;
253 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileId> { 253 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileId> {
254 self.uri.try_conv_with(world) 254 self.uri.try_conv_with(world)
255 } 255 }
256} 256}
257 257
258impl TryConvWith<&'_ WorldSnapshot> for &'_ VersionedTextDocumentIdentifier { 258impl TryConvWith<&WorldSnapshot> for &VersionedTextDocumentIdentifier {
259 type Output = FileId; 259 type Output = FileId;
260 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileId> { 260 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileId> {
261 self.uri.try_conv_with(world) 261 self.uri.try_conv_with(world)
262 } 262 }
263} 263}
264 264
265impl TryConvWith<&'_ WorldSnapshot> for &'_ TextDocumentIdentifier { 265impl TryConvWith<&WorldSnapshot> for &TextDocumentIdentifier {
266 type Output = FileId; 266 type Output = FileId;
267 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileId> { 267 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileId> {
268 world.uri_to_file_id(&self.uri) 268 world.uri_to_file_id(&self.uri)
269 } 269 }
270} 270}
271 271
272impl TryConvWith<&'_ WorldSnapshot> for &'_ TextDocumentPositionParams { 272impl TryConvWith<&WorldSnapshot> for &TextDocumentPositionParams {
273 type Output = FilePosition; 273 type Output = FilePosition;
274 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FilePosition> { 274 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FilePosition> {
275 let file_id = self.text_document.try_conv_with(world)?; 275 let file_id = self.text_document.try_conv_with(world)?;
@@ -279,7 +279,7 @@ impl TryConvWith<&'_ WorldSnapshot> for &'_ TextDocumentPositionParams {
279 } 279 }
280} 280}
281 281
282impl TryConvWith<&'_ WorldSnapshot> for (&'_ TextDocumentIdentifier, Range) { 282impl TryConvWith<&WorldSnapshot> for (&TextDocumentIdentifier, Range) {
283 type Output = FileRange; 283 type Output = FileRange;
284 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileRange> { 284 fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileRange> {
285 let file_id = self.0.try_conv_with(world)?; 285 let file_id = self.0.try_conv_with(world)?;
@@ -300,7 +300,7 @@ impl<T: TryConvWith<CTX>, CTX: Copy> TryConvWith<CTX> for Vec<T> {
300 } 300 }
301} 301}
302 302
303impl TryConvWith<&'_ WorldSnapshot> for SourceChange { 303impl TryConvWith<&WorldSnapshot> for SourceChange {
304 type Output = req::SourceChange; 304 type Output = req::SourceChange;
305 fn try_conv_with(self, world: &WorldSnapshot) -> Result<req::SourceChange> { 305 fn try_conv_with(self, world: &WorldSnapshot) -> Result<req::SourceChange> {
306 let cursor_position = match self.cursor_position { 306 let cursor_position = match self.cursor_position {
@@ -339,7 +339,7 @@ impl TryConvWith<&'_ WorldSnapshot> for SourceChange {
339 } 339 }
340} 340}
341 341
342impl TryConvWith<&'_ WorldSnapshot> for SourceFileEdit { 342impl TryConvWith<&WorldSnapshot> for SourceFileEdit {
343 type Output = TextDocumentEdit; 343 type Output = TextDocumentEdit;
344 fn try_conv_with(self, world: &WorldSnapshot) -> Result<TextDocumentEdit> { 344 fn try_conv_with(self, world: &WorldSnapshot) -> Result<TextDocumentEdit> {
345 let text_document = VersionedTextDocumentIdentifier { 345 let text_document = VersionedTextDocumentIdentifier {
@@ -354,7 +354,7 @@ impl TryConvWith<&'_ WorldSnapshot> for SourceFileEdit {
354 } 354 }
355} 355}
356 356
357impl TryConvWith<&'_ WorldSnapshot> for FileSystemEdit { 357impl TryConvWith<&WorldSnapshot> for FileSystemEdit {
358 type Output = ResourceOp; 358 type Output = ResourceOp;
359 fn try_conv_with(self, world: &WorldSnapshot) -> Result<ResourceOp> { 359 fn try_conv_with(self, world: &WorldSnapshot) -> Result<ResourceOp> {
360 let res = match self { 360 let res = match self {
@@ -372,7 +372,7 @@ impl TryConvWith<&'_ WorldSnapshot> for FileSystemEdit {
372 } 372 }
373} 373}
374 374
375impl TryConvWith<&'_ WorldSnapshot> for &NavigationTarget { 375impl TryConvWith<&WorldSnapshot> for &NavigationTarget {
376 type Output = Location; 376 type Output = Location;
377 fn try_conv_with(self, world: &WorldSnapshot) -> Result<Location> { 377 fn try_conv_with(self, world: &WorldSnapshot) -> Result<Location> {
378 let line_index = world.analysis().file_line_index(self.file_id())?; 378 let line_index = world.analysis().file_line_index(self.file_id())?;
@@ -381,7 +381,7 @@ impl TryConvWith<&'_ WorldSnapshot> for &NavigationTarget {
381 } 381 }
382} 382}
383 383
384impl TryConvWith<&'_ WorldSnapshot> for (FileId, RangeInfo<NavigationTarget>) { 384impl TryConvWith<&WorldSnapshot> for (FileId, RangeInfo<NavigationTarget>) {
385 type Output = LocationLink; 385 type Output = LocationLink;
386 fn try_conv_with(self, world: &WorldSnapshot) -> Result<LocationLink> { 386 fn try_conv_with(self, world: &WorldSnapshot) -> Result<LocationLink> {
387 let (src_file_id, target) = self; 387 let (src_file_id, target) = self;
@@ -408,7 +408,7 @@ impl TryConvWith<&'_ WorldSnapshot> for (FileId, RangeInfo<NavigationTarget>) {
408 } 408 }
409} 409}
410 410
411impl TryConvWith<&'_ WorldSnapshot> for (FileId, RangeInfo<Vec<NavigationTarget>>) { 411impl TryConvWith<&WorldSnapshot> for (FileId, RangeInfo<Vec<NavigationTarget>>) {
412 type Output = req::GotoDefinitionResponse; 412 type Output = req::GotoDefinitionResponse;
413 fn try_conv_with(self, world: &WorldSnapshot) -> Result<req::GotoTypeDefinitionResponse> { 413 fn try_conv_with(self, world: &WorldSnapshot) -> Result<req::GotoTypeDefinitionResponse> {
414 let (file_id, RangeInfo { range, info: navs }) = self; 414 let (file_id, RangeInfo { range, info: navs }) = self;