Fix type typo in add_missing_impl_members doc

This commit is contained in:
Lukas Wirth 2020-12-25 18:15:31 +01:00
parent e1acb0ca5c
commit e7dd73ea9e
2 changed files with 18 additions and 14 deletions

View file

@ -15,7 +15,7 @@ use crate::{
//
// ```
// trait Trait<T> {
// Type X;
// type X;
// fn foo(&self) -> T;
// fn bar(&self) {}
// }
@ -27,14 +27,16 @@ use crate::{
// ->
// ```
// trait Trait<T> {
// Type X;
// type X;
// fn foo(&self) -> T;
// fn bar(&self) {}
// }
//
// impl Trait<u32> for () {
// $0type X;
//
// fn foo(&self) -> u32 {
// ${0:todo!()}
// todo!()
// }
// }
// ```
@ -54,13 +56,13 @@ pub(crate) fn add_missing_impl_members(acc: &mut Assists, ctx: &AssistContext) -
//
// ```
// trait Trait {
// Type X;
// type X;
// fn foo(&self);
// fn bar(&self) {}
// }
//
// impl Trait for () {
// Type X = ();
// type X = ();
// fn foo(&self) {}<|>
//
// }
@ -68,13 +70,13 @@ pub(crate) fn add_missing_impl_members(acc: &mut Assists, ctx: &AssistContext) -
// ->
// ```
// trait Trait {
// Type X;
// type X;
// fn foo(&self);
// fn bar(&self) {}
// }
//
// impl Trait for () {
// Type X = ();
// type X = ();
// fn foo(&self) {}
//
// $0fn bar(&self) {}

View file

@ -42,26 +42,26 @@ fn doctest_add_impl_default_members() {
"add_impl_default_members",
r#####"
trait Trait {
Type X;
type X;
fn foo(&self);
fn bar(&self) {}
}
impl Trait for () {
Type X = ();
type X = ();
fn foo(&self) {}<|>
}
"#####,
r#####"
trait Trait {
Type X;
type X;
fn foo(&self);
fn bar(&self) {}
}
impl Trait for () {
Type X = ();
type X = ();
fn foo(&self) {}
$0fn bar(&self) {}
@ -76,7 +76,7 @@ fn doctest_add_impl_missing_members() {
"add_impl_missing_members",
r#####"
trait Trait<T> {
Type X;
type X;
fn foo(&self) -> T;
fn bar(&self) {}
}
@ -87,14 +87,16 @@ impl Trait<u32> for () {<|>
"#####,
r#####"
trait Trait<T> {
Type X;
type X;
fn foo(&self) -> T;
fn bar(&self) {}
}
impl Trait<u32> for () {
$0type X;
fn foo(&self) -> u32 {
${0:todo!()}
todo!()
}
}
"#####,