Symplify by using into()

This commit is contained in:
Jeremy Kolb 2019-07-04 18:04:46 -04:00
parent 0ab5b1121a
commit b4c0c7f79c
2 changed files with 7 additions and 7 deletions

View file

@ -2,7 +2,7 @@ use std::{fmt::Write as _, io::Write as _};
use gen_lsp_server::ErrorCode;
use lsp_types::{
CodeAction, CodeActionOrCommand, CodeActionResponse, CodeLens, Command, Diagnostic,
CodeAction, CodeActionResponse, CodeLens, Command, Diagnostic,
DiagnosticSeverity, DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange,
FoldingRangeKind, FoldingRangeParams, Hover, HoverContents, Location, MarkupContent,
MarkupKind, Position, PrepareRenameResponse, Range, RenameParams, SymbolInformation,
@ -689,7 +689,7 @@ pub fn handle_code_action(
edit: None,
command: Some(command),
};
res.push(CodeActionOrCommand::CodeAction(action));
res.push(action.into());
}
for assist in assists {
@ -711,7 +711,7 @@ pub fn handle_code_action(
edit: None,
command: Some(command),
};
res.push(CodeActionOrCommand::CodeAction(action));
res.push(action.into());
}
Ok(Some(res))