File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ impl<'a> Cursor<'a> {
27
27
self . rest . starts_with ( s)
28
28
}
29
29
30
+ fn starts_with_char ( & self , ch : char ) -> bool {
31
+ self . rest . starts_with ( ch)
32
+ }
33
+
30
34
fn is_empty ( & self ) -> bool {
31
35
self . rest . is_empty ( )
32
36
}
@@ -756,7 +760,7 @@ fn digits(mut input: Cursor) -> Result<Cursor, Reject> {
756
760
fn punct ( input : Cursor ) -> PResult < Punct > {
757
761
let ( rest, ch) = punct_char ( input) ?;
758
762
if ch == '\'' {
759
- if ident_any ( rest) ?. 0 . starts_with ( "'" ) {
763
+ if ident_any ( rest) ?. 0 . starts_with_char ( '\'' ) {
760
764
Err ( Reject )
761
765
} else {
762
766
Ok ( ( rest, Punct :: new ( '\'' , Spacing :: Joint ) ) )
@@ -848,7 +852,7 @@ fn doc_comment_contents(input: Cursor) -> PResult<(&str, bool)> {
848
852
Ok ( ( input, ( & s[ 3 ..s. len ( ) - 2 ] , true ) ) )
849
853
} else if input. starts_with ( "///" ) {
850
854
let input = input. advance ( 3 ) ;
851
- if input. starts_with ( "/" ) {
855
+ if input. starts_with_char ( '/' ) {
852
856
return Err ( Reject ) ;
853
857
}
854
858
let ( input, s) = take_until_newline_or_eof ( input) ;
You can’t perform that action at this time.
0 commit comments