Skip to content

Commit 965b14d

Browse files
committed
Fix compilation errors
1 parent 027f263 commit 965b14d

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

crates/proc-macro-srv/src/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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()?)

crates/proc-macro-srv/src/server/rust_analyzer_span.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
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;
87
use 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));

crates/proc-macro-srv/src/server/token_id.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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));

0 commit comments

Comments
 (0)