Skip to content

Commit d849124

Browse files
committed
Fix add_life_to_type label typo
1 parent dc8e2fe commit d849124

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

crates/ide_assists/src/handlers/add_lifetime_to_type.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ pub(crate) fn add_lifetime_to_type(acc: &mut Assists, ctx: &AssistContext) -> Op
2929
let node = ctx.find_node_at_offset::<ast::Adt>()?;
3030
let has_lifetime = node
3131
.generic_param_list()
32-
.map(|gen_list| gen_list.lifetime_params().count() > 0)
33-
.unwrap_or_default();
32+
.map_or(false, |gen_list| gen_list.lifetime_params().next().is_some());
3433

3534
if has_lifetime {
3635
return None;
@@ -41,7 +40,7 @@ pub(crate) fn add_lifetime_to_type(acc: &mut Assists, ctx: &AssistContext) -> Op
4140

4241
acc.add(
4342
AssistId("add_lifetime_to_type", AssistKind::Generate),
44-
"Add lifetime`",
43+
"Add lifetime",
4544
target,
4645
|builder| {
4746
match node.generic_param_list() {

crates/ide_assists/src/handlers/add_turbo_fish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::{
2626
pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
2727
let ident = ctx.find_token_syntax_at_offset(SyntaxKind::IDENT).or_else(|| {
2828
let arg_list = ctx.find_node_at_offset::<ast::ArgList>()?;
29-
if arg_list.args().count() > 0 {
29+
if arg_list.args().next().is_some() {
3030
return None;
3131
}
3232
cov_mark::hit!(add_turbo_fish_after_call);

0 commit comments

Comments
 (0)