File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,18 @@ pub struct QualifiedName {
7
7
}
8
8
9
9
impl QualifiedName {
10
+ pub fn parse_quoted ( lit : & LitStr ) -> Result < Self > {
11
+ if lit. value ( ) . is_empty ( ) {
12
+ let segments = Vec :: new ( ) ;
13
+ Ok ( QualifiedName { segments } )
14
+ } else {
15
+ lit. parse_with ( |input : ParseStream | {
16
+ let allow_raw = false ;
17
+ parse_unquoted ( input, allow_raw)
18
+ } )
19
+ }
20
+ }
21
+
10
22
pub fn parse_unquoted ( input : ParseStream ) -> Result < Self > {
11
23
let allow_raw = true ;
12
24
parse_unquoted ( input, allow_raw)
@@ -15,15 +27,7 @@ impl QualifiedName {
15
27
pub fn parse_quoted_or_unquoted ( input : ParseStream ) -> Result < Self > {
16
28
if input. peek ( LitStr ) {
17
29
let lit: LitStr = input. parse ( ) ?;
18
- if lit. value ( ) . is_empty ( ) {
19
- let segments = Vec :: new ( ) ;
20
- Ok ( QualifiedName { segments } )
21
- } else {
22
- lit. parse_with ( |input : ParseStream | {
23
- let allow_raw = false ;
24
- parse_unquoted ( input, allow_raw)
25
- } )
26
- }
30
+ Self :: parse_quoted ( & lit)
27
31
} else {
28
32
Self :: parse_unquoted ( input)
29
33
}
You can’t perform that action at this time.
0 commit comments