aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-05 18:23:40 +0100
committerGitHub <[email protected]>2021-06-05 18:23:40 +0100
commitad9234fef2a90105448214255669fb46a382c3a5 (patch)
treee09f9b33d359c9871f03a413b44630509fb97406 /crates/hir_def
parent5092d8c1ae50010d35f6860b6420a69ddcd9ca45 (diff)
parent544eca10d6313eee45eee1bae7fcf7e3dd3f2d3a (diff)
Merge #9140
9140: feat: Render documentation for derive completion r=Veykril a=Veykril ![eEzGiq2wNa](https://user-images.githubusercontent.com/3757771/120847308-9c5a3300-c573-11eb-958d-e0f22f4757ed.gif) Nothing fancy as all the std derives aren't really documented though maybe some 3rd party crates document them equally to their trait counterparts. Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/attr.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs
index 385ba8c80..b7e72b790 100644
--- a/crates/hir_def/src/attr.rs
+++ b/crates/hir_def/src/attr.rs
@@ -36,6 +36,10 @@ use crate::{
36pub struct Documentation(String); 36pub struct Documentation(String);
37 37
38impl Documentation { 38impl Documentation {
39 pub fn new(s: impl Into<String>) -> Self {
40 Documentation(s.into())
41 }
42
39 pub fn as_str(&self) -> &str { 43 pub fn as_str(&self) -> &str {
40 &self.0 44 &self.0
41 } 45 }