Do less panicking in general
This commit is contained in:
parent
3a872782d3
commit
11e0ba4340
3 changed files with 24 additions and 2 deletions
|
@ -120,6 +120,10 @@ pub fn parse_expr_from_source_str<'a>(name: String,
|
|||
p.parse_expr()
|
||||
}
|
||||
|
||||
/// Parses an item.
|
||||
///
|
||||
/// Returns `Ok(Some(item))` when successful, `Ok(None)` when no item was found, and`Err`
|
||||
/// when a syntax error occurred.
|
||||
pub fn parse_item_from_source_str<'a>(name: String,
|
||||
source: String,
|
||||
cfg: ast::CrateConfig,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue