diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-03 08:46:46 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-03 08:46:46 +0100 |
commit | 2cee8531c5236ae7d66717bea604f1224c23ea56 (patch) | |
tree | b2e2de013f8c028b5cd70ac421c8e8f7d4c6bfb5 /crates/ra_assists/src/lib.rs | |
parent | 642f3f4bd62019d8c0fdd6304ff07d87a5aca627 (diff) | |
parent | 6a2127be28a837215801f4ac3cd7d46ef7c4485b (diff) |
Merge #3814
3814: Add impl From for enum variant assist r=flodiebold a=mattyhall
Basically adds a From impl for tuple enum variants with one field. It was recommended to me on the zulip to maybe try using the trait solver, but I had trouble with that as, although it could resolve the trait impl, it couldn't resolve the variable unambiguously in real use. I'm also unsure of how it would work if there were already multiple From impls to resolve - I can't see a way we could get more than one solution to my query.
Fixes #3766
Co-authored-by: Matthew Hall <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r-- | crates/ra_assists/src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index fa1f3dd26..6b4c56dcd 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -122,6 +122,7 @@ mod handlers { | |||
122 | mod replace_qualified_name_with_use; | 122 | mod replace_qualified_name_with_use; |
123 | mod replace_unwrap_with_match; | 123 | mod replace_unwrap_with_match; |
124 | mod split_import; | 124 | mod split_import; |
125 | mod add_from_impl_for_enum; | ||
125 | 126 | ||
126 | pub(crate) fn all() -> &'static [AssistHandler] { | 127 | pub(crate) fn all() -> &'static [AssistHandler] { |
127 | &[ | 128 | &[ |
@@ -159,6 +160,7 @@ mod handlers { | |||
159 | replace_qualified_name_with_use::replace_qualified_name_with_use, | 160 | replace_qualified_name_with_use::replace_qualified_name_with_use, |
160 | replace_unwrap_with_match::replace_unwrap_with_match, | 161 | replace_unwrap_with_match::replace_unwrap_with_match, |
161 | split_import::split_import, | 162 | split_import::split_import, |
163 | add_from_impl_for_enum::add_from_impl_for_enum, | ||
162 | ] | 164 | ] |
163 | } | 165 | } |
164 | } | 166 | } |