diff options
author | Lukas Wirth <[email protected]> | 2021-06-04 19:25:16 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-06-04 19:58:12 +0100 |
commit | 752485083151de5cb6056289db74ffee6407a4ff (patch) | |
tree | 97a910e5076f236834eec9c21760948be52c8d95 /crates/hir_def | |
parent | 98395f29a417b37a5969594f0cac5ae23585da85 (diff) |
Render documentation for derive completion
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/attr.rs | 4 |
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::{ | |||
36 | pub struct Documentation(String); | 36 | pub struct Documentation(String); |
37 | 37 | ||
38 | impl Documentation { | 38 | impl 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 | } |