Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/hover/render.rs')
-rw-r--r--crates/ide/src/hover/render.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ide/src/hover/render.rs b/crates/ide/src/hover/render.rs
index eff055c959..42342d94b6 100644
--- a/crates/ide/src/hover/render.rs
+++ b/crates/ide/src/hover/render.rs
@@ -264,7 +264,7 @@ pub(super) fn keyword(
let markup = process_markup(
sema.db,
Definition::Module(doc_owner),
- &markup(Some(docs.into()), description, None)?,
+ &markup(Some(docs.into()), description, None),
config,
);
Some(HoverResult { markup, actions })
@@ -396,11 +396,11 @@ pub(super) fn definition(
famous_defs: Option<&FamousDefs<'_, '_>>,
notable_traits: &[(Trait, Vec<(Option<Type>, Name)>)],
config: &HoverConfig,
-) -> Option<Markup> {
+) -> Markup {
let mod_path = definition_mod_path(db, &def);
- let label = def.label(db)?;
+ let label = def.label(db);
let docs = def.docs(db, famous_defs);
- let value = match def {
+ let value = (|| match def {
Definition::Variant(it) => {
if !it.parent_enum(db).is_data_carrying(db) {
match it.eval(db) {
@@ -436,7 +436,7 @@ pub(super) fn definition(
Some(body.to_string())
}
_ => None,
- };
+ })();
let layout_info = match def {
Definition::Field(it) => render_memory_layout(
@@ -683,7 +683,7 @@ fn definition_mod_path(db: &RootDatabase, def: &Definition) -> Option<String> {
def.module(db).map(|module| path(db, module, definition_owner_name(db, def)))
}
-fn markup(docs: Option<String>, desc: String, mod_path: Option<String>) -> Option<Markup> {
+fn markup(docs: Option<String>, desc: String, mod_path: Option<String>) -> Markup {
let mut buf = String::new();
if let Some(mod_path) = mod_path {
@@ -696,7 +696,7 @@ fn markup(docs: Option<String>, desc: String, mod_path: Option<String>) -> Optio
if let Some(doc) = docs {
format_to!(buf, "\n___\n\n{}", doc);
}
- Some(buf.into())
+ buf.into()
}
fn find_std_module(famous_defs: &FamousDefs<'_, '_>, name: &str) -> Option<hir::Module> {