]> git.lizzy.rs Git - rust.git/commitdiff
Add assist: add lifetime to type #7200
authorBenjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Mon, 18 Jan 2021 19:38:52 +0000 (20:38 +0100)
committerBenjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Mon, 18 Jan 2021 19:38:52 +0000 (20:38 +0100)
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
crates/assists/src/handlers/add_lifetime_to_type.rs

index c7af84704654cf6d739572f017e62874b27034d7..3743858a80b447f8159d5fc4e371a53e39046bbe 100644 (file)
@@ -158,6 +158,12 @@ fn add_lifetime_to_struct() {
             "struct Foo<'a> { a: &'a i32, b: &'a usize }",
         );
 
+        check_assist(
+            add_lifetime_to_type,
+            "struct Foo { a: &$0i32, b: usize }",
+            "struct Foo<'a> { a: &'a i32, b: usize }",
+        );
+
         check_assist(
             add_lifetime_to_type,
             "struct Foo<T>$0 { a: &T, b: usize }",