Avoid collect_vec from itertools
This commit is contained in:
parent
fdf1136e79
commit
53ddf48df4
@ -1,5 +1,4 @@
|
||||
use ide_db::defs::{Definition, NameRefClass};
|
||||
use itertools::Itertools;
|
||||
use syntax::{ast, AstNode, SyntaxKind, T};
|
||||
|
||||
use crate::{
|
||||
@ -79,7 +78,7 @@ pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext) -> Option<(
|
||||
}
|
||||
|
||||
let number_of_arguments = generics.len();
|
||||
let fish_head = std::iter::repeat("_").take(number_of_arguments).collect_vec().join(",");
|
||||
let fish_head = std::iter::repeat("_").take(number_of_arguments).collect::<Vec<_>>().join(",");
|
||||
|
||||
acc.add(
|
||||
AssistId("add_turbo_fish", AssistKind::RefactorRewrite),
|
||||
|
@ -3,7 +3,6 @@ use ide_db::{
|
||||
defs::Definition,
|
||||
search::{FileReference, SearchScope, UsageSearchResult},
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use syntax::{
|
||||
ast::{self, AstNode, FieldExpr, HasName, IdentPat, MethodCallExpr},
|
||||
TextRange,
|
||||
@ -121,7 +120,7 @@ fn collect_data(ident_pat: IdentPat, ctx: &AssistContext) -> Option<TupleData> {
|
||||
|
||||
let field_names = (0..field_types.len())
|
||||
.map(|i| generate_name(ctx, i, &name, &ident_pat, &usages))
|
||||
.collect_vec();
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Some(TupleData { ident_pat, range, ref_type, field_names, usages })
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ use ide::{
|
||||
SourceChange, TextEdit,
|
||||
};
|
||||
use ide_db::SymbolKind;
|
||||
use itertools::Itertools;
|
||||
use lsp_server::ErrorCode;
|
||||
use lsp_types::{
|
||||
CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem,
|
||||
@ -854,7 +853,7 @@ pub(crate) fn handle_completion_resolve(
|
||||
)?
|
||||
.into_iter()
|
||||
.flat_map(|edit| edit.into_iter().map(|indel| to_proto::text_edit(&line_index, indel)))
|
||||
.collect_vec();
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if !all_edits_are_disjoint(&original_completion, &additional_edits) {
|
||||
return Err(LspError::new(
|
||||
@ -1164,7 +1163,7 @@ pub(crate) fn handle_code_action_resolve(
|
||||
}
|
||||
|
||||
fn parse_action_id(action_id: &str) -> Result<(usize, SingleResolve), String> {
|
||||
let id_parts = action_id.split(':').collect_vec();
|
||||
let id_parts = action_id.split(':').collect::<Vec<_>>();
|
||||
match id_parts.as_slice() {
|
||||
[assist_id_string, assist_kind_string, index_string] => {
|
||||
let assist_kind: AssistKind = assist_kind_string.parse()?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user