From 33026c654e3a667e25ea27004c22be138ed83d33 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 8 Jun 2019 14:16:05 +0300 Subject: make Docs handing more ideomatic --- crates/ra_hir/src/docs.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir/src/docs.rs') diff --git a/crates/ra_hir/src/docs.rs b/crates/ra_hir/src/docs.rs index c2279fe95..38c0922eb 100644 --- a/crates/ra_hir/src/docs.rs +++ b/crates/ra_hir/src/docs.rs @@ -1,24 +1,24 @@ use ra_syntax::ast; -use crate::{HirDatabase, Module, StructField, Struct, Enum, EnumVariant, Static, Const, Function, Union}; +use crate::{HirDatabase, Module, StructField, Struct, Enum, EnumVariant, Static, Const, Function, Union, Trait, TypeAlias, FieldSource}; /// Holds documentation #[derive(Debug, Clone)] pub struct Documentation(String); impl Documentation { - pub fn new(s: &str) -> Self { - Self(s.into()) + fn new(s: &str) -> Documentation { + Documentation(s.into()) } - pub fn contents(&self) -> &str { + pub fn as_str(&self) -> &str { &self.0 } } impl Into for Documentation { fn into(self) -> String { - self.contents().into() + self.0.clone() } } -- cgit v1.2.3