Skip to content

Commit

Permalink
feat: ty
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Jun 14, 2024
1 parent b895036 commit 802c265
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(crate) fn parse_crate(
vis: HirVisibility::Public,
namespace: crate_name.namespace(),
};
let root_module = parse_module(file.items, info, config)?;
let root_module = parse_module(file.items, info, config)?.unwrap();
Ok(HirTreeCrate {
name: crate_name.to_owned(),
root_module,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub(super) fn parse_module(
items: Vec<syn::Item>,
meta: HirTreeModuleMeta,
config: &ParserHirInternalConfig,
) -> anyhow::Result<HirTreeModule> {
) -> anyhow::Result<Option<HirTreeModule>> {
let mut output_items = vec![];
let mut output_modules = vec![];

Expand All @@ -24,11 +24,11 @@ pub(super) fn parse_module(
}
}

Ok(HirTreeModule {
Ok(Some(HirTreeModule {
meta,
items: output_items,
modules: output_modules,
})
}))
}

fn parse_syn_item_mod(
Expand All @@ -43,7 +43,7 @@ fn parse_syn_item_mod(
vis: (&item_mod.vis).into(),
namespace: namespace.join(&item_mod.ident.to_string()),
};
Some(parse_module(items, info, config)?)
parse_module(items, info, config)?
} else {
None
})
Expand Down

0 comments on commit 802c265

Please sign in to comment.