mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Return Option<Parse<ast::Literal>>
from ast::Literal::parse
This commit is contained in:
parent
1918f9b9e0
commit
4923b8a74b
3 changed files with 11 additions and 8 deletions
|
@ -71,7 +71,7 @@ impl server::FreeFunctions for RaSpanServer {
|
|||
&mut self,
|
||||
s: &str,
|
||||
) -> Result<bridge::Literal<Self::Span, Self::Symbol>, ()> {
|
||||
let literal = ast::Literal::parse(s);
|
||||
let literal = ast::Literal::parse(s).ok_or(())?;
|
||||
let literal = literal.tree();
|
||||
|
||||
let kind = literal_to_external(literal.kind()).ok_or(())?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue