diff options
author | jake <[email protected]> | 2021-04-11 08:31:20 +0100 |
---|---|---|
committer | jake <[email protected]> | 2021-04-11 08:42:05 +0100 |
commit | a624e2ea8d6fc97df03f663581e082541fd0348f (patch) | |
tree | 452586c51fda1939f6af09fa5b2bd71889333511 /crates/ide_assists/src/tests | |
parent | 5b40342d2d5bc19445e6abccef6931bdd3a03c3b (diff) |
Adds impl Deref assist
Diffstat (limited to 'crates/ide_assists/src/tests')
-rw-r--r-- | crates/ide_assists/src/tests/generated.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs index 27a22ca10..41559b43a 100644 --- a/crates/ide_assists/src/tests/generated.rs +++ b/crates/ide_assists/src/tests/generated.rs | |||
@@ -552,6 +552,33 @@ impl Default for Example { | |||
552 | } | 552 | } |
553 | 553 | ||
554 | #[test] | 554 | #[test] |
555 | fn doctest_generate_deref() { | ||
556 | check_doc_test( | ||
557 | "generate_deref", | ||
558 | r#####" | ||
559 | struct A; | ||
560 | struct B { | ||
561 | $0a: A | ||
562 | } | ||
563 | "#####, | ||
564 | r#####" | ||
565 | struct A; | ||
566 | struct B { | ||
567 | a: A | ||
568 | } | ||
569 | |||
570 | impl std::ops::Deref for B { | ||
571 | type Target = A; | ||
572 | |||
573 | fn deref(&self) -> &Self::Target { | ||
574 | &self.a | ||
575 | } | ||
576 | } | ||
577 | "#####, | ||
578 | ) | ||
579 | } | ||
580 | |||
581 | #[test] | ||
555 | fn doctest_generate_derive() { | 582 | fn doctest_generate_derive() { |
556 | check_doc_test( | 583 | check_doc_test( |
557 | "generate_derive", | 584 | "generate_derive", |