From 8915183d7da07a4b295e5e93a889dea4c15024a0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 31 May 2020 09:59:38 +0200 Subject: Don't require module docs for Features and Assists --- .../ra_assists/src/handlers/add_from_impl_for_enum.rs | 4 ++-- crates/ra_assists/src/tests/generated.rs | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists') diff --git a/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs b/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs index 6a675e812..776bddf91 100644 --- a/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs +++ b/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs @@ -4,9 +4,9 @@ use test_utils::mark; use crate::{utils::FamousDefs, AssistContext, AssistId, Assists}; -// Assist add_from_impl_for_enum +// Assist: add_from_impl_for_enum // -// Adds a From impl for an enum variant with one tuple field +// Adds a From impl for an enum variant with one tuple field. // // ``` // enum A { <|>One(u32) } diff --git a/crates/ra_assists/src/tests/generated.rs b/crates/ra_assists/src/tests/generated.rs index 250e56a69..4e0536828 100644 --- a/crates/ra_assists/src/tests/generated.rs +++ b/crates/ra_assists/src/tests/generated.rs @@ -58,6 +58,25 @@ fn main() { ) } +#[test] +fn doctest_add_from_impl_for_enum() { + check_doc_test( + "add_from_impl_for_enum", + r#####" +enum A { <|>One(u32) } +"#####, + r#####" +enum A { One(u32) } + +impl From for A { + fn from(v: u32) -> Self { + A::One(v) + } +} +"#####, + ) +} + #[test] fn doctest_add_function() { check_doc_test( -- cgit v1.2.3