File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
crates/proc-macro-srv/src Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,8 @@ fn spacing_to_external(spacing: Spacing) -> proc_macro::Spacing {
5555 }
5656}
5757
58- fn literal_to_external ( literal : ast:: LiteralKind ) -> Option < proc_macro:: bridge:: LitKind > {
59- Some ( match lit . kind ( ) {
58+ fn literal_to_external ( literal_kind : ast:: LiteralKind ) -> Option < proc_macro:: bridge:: LitKind > {
59+ Some ( match literal_kind {
6060 ast:: LiteralKind :: String ( data) => {
6161 if data. is_raw ( ) {
6262 bridge:: LitKind :: StrRaw ( data. raw_delimiter_count ( ) ?)
Original file line number Diff line number Diff line change 44//! It is an unfortunate result of how the proc-macro API works that we need to look into the
55//! concrete representation of the spans, and as such, RustRover cannot make use of this unless they
66//! change their representation to be compatible with rust-analyzer's.
7- use core:: num;
87use std:: {
98 collections:: { HashMap , HashSet } ,
109 iter,
@@ -72,13 +71,14 @@ impl server::FreeFunctions for RaSpanServer {
7271 & mut self ,
7372 s : & str ,
7473 ) -> Result < bridge:: Literal < Self :: Span , Self :: Symbol > , ( ) > {
75- let literal = str_to_lit_node ( s) . ok_or ( Err ( ( ) ) ) ?;
74+ let literal = str_to_lit_node ( s) . ok_or ( ( ) ) ?;
7675
77- let kind = literal_to_external ( literal. kind ( ) ) . ok_or ( Err ( ( ) ) ) ?;
76+ let kind = literal_to_external ( literal. kind ( ) ) . ok_or ( ( ) ) ?;
7877
7978 // FIXME: handle more than just int and float suffixes
8079 let suffix = match literal. kind ( ) {
81- ast:: LiteralKind :: FloatNumber ( num) | ast:: LiteralKind :: IntNumber ( num) => num. suffix ( ) ,
80+ ast:: LiteralKind :: FloatNumber ( num) => num. suffix ( ) ,
81+ ast:: LiteralKind :: IntNumber ( num) => num. suffix ( ) ,
8282 _ => None ,
8383 }
8484 . map ( |suffix| Symbol :: intern ( self . interner , suffix) ) ;
Original file line number Diff line number Diff line change @@ -63,13 +63,14 @@ impl server::FreeFunctions for TokenIdServer {
6363 & mut self ,
6464 s : & str ,
6565 ) -> Result < bridge:: Literal < Self :: Span , Self :: Symbol > , ( ) > {
66- let literal = str_to_lit_node ( s) . ok_or ( Err ( ( ) ) ) ?;
66+ let literal = str_to_lit_node ( s) . ok_or ( ( ) ) ?;
6767
68- let kind = literal_to_external ( literal. kind ( ) ) . ok_or ( Err ( ( ) ) ) ?;
68+ let kind = literal_to_external ( literal. kind ( ) ) . ok_or ( ( ) ) ?;
6969
7070 // FIXME: handle more than just int and float suffixes
7171 let suffix = match literal. kind ( ) {
72- ast:: LiteralKind :: FloatNumber ( num) | ast:: LiteralKind :: IntNumber ( num) => num. suffix ( ) ,
72+ ast:: LiteralKind :: FloatNumber ( num) => num. suffix ( ) ,
73+ ast:: LiteralKind :: IntNumber ( num) => num. suffix ( ) ,
7374 _ => None ,
7475 }
7576 . map ( |suffix| Symbol :: intern ( self . interner , suffix) ) ;
You can’t perform that action at this time.
0 commit comments