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/code_model.rs | 1 - crates/ra_hir/src/docs.rs | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 59d7d589a..861d6aefe 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -12,7 +12,6 @@ use crate::{ ty::{TraitRef, InferenceResult, primitive::{IntTy, FloatTy, Signedness, IntBitness, FloatBitness}}, adt::{EnumVariantId, StructFieldId, VariantDef}, generics::HasGenericParams, - docs::{Documentation, Docs, docs_from_ast}, ids::{FunctionId, StructId, EnumId, AstItemDef, ConstId, StaticId, TraitId, TypeAliasId, MacroDefId}, impl_block::ImplBlock, resolve::Resolver, 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