File tree 3 files changed +10
-9
lines changed
crates/proc-macro-srv/src
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 {
55
55
}
56
56
}
57
57
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 {
60
60
ast:: LiteralKind :: String ( data) => {
61
61
if data. is_raw ( ) {
62
62
bridge:: LitKind :: StrRaw ( data. raw_delimiter_count ( ) ?)
Original file line number Diff line number Diff line change 4
4
//! It is an unfortunate result of how the proc-macro API works that we need to look into the
5
5
//! concrete representation of the spans, and as such, RustRover cannot make use of this unless they
6
6
//! change their representation to be compatible with rust-analyzer's.
7
- use core:: num;
8
7
use std:: {
9
8
collections:: { HashMap , HashSet } ,
10
9
iter,
@@ -72,13 +71,14 @@ impl server::FreeFunctions for RaSpanServer {
72
71
& mut self ,
73
72
s : & str ,
74
73
) -> 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 ( ( ) ) ?;
76
75
77
- let kind = literal_to_external ( literal. kind ( ) ) . ok_or ( Err ( ( ) ) ) ?;
76
+ let kind = literal_to_external ( literal. kind ( ) ) . ok_or ( ( ) ) ?;
78
77
79
78
// FIXME: handle more than just int and float suffixes
80
79
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 ( ) ,
82
82
_ => None ,
83
83
}
84
84
. 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 {
63
63
& mut self ,
64
64
s : & str ,
65
65
) -> 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 ( ( ) ) ?;
67
67
68
- let kind = literal_to_external ( literal. kind ( ) ) . ok_or ( Err ( ( ) ) ) ?;
68
+ let kind = literal_to_external ( literal. kind ( ) ) . ok_or ( ( ) ) ?;
69
69
70
70
// FIXME: handle more than just int and float suffixes
71
71
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 ( ) ,
73
74
_ => None ,
74
75
}
75
76
. map ( |suffix| Symbol :: intern ( self . interner , suffix) ) ;
You can’t perform that action at this time.
0 commit comments