Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit fe46c95

Browse files
authored
Merge pull request #1638 from matthiaskrgr/clippy_5
fix clippy warnings
2 parents bf1d8f9 + c47454d commit fe46c95

File tree

19 files changed

+12
-38
lines changed

19 files changed

+12
-38
lines changed

rls-rustc/src/ipc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ impl From<RpcChannel> for Client {
2323
pub struct IpcFileLoader(FileLoaderClient);
2424

2525
impl IpcFileLoader {
26-
pub fn into_boxed(self) -> Option<Box<dyn syntax::source_map::FileLoader + Send + Sync>> {
26+
pub fn into_boxed(self) -> Option<Box<dyn rustc_span::source_map::FileLoader + Send + Sync>> {
2727
Some(Box::new(self))
2828
}
2929
}
3030

31-
impl syntax::source_map::FileLoader for IpcFileLoader {
31+
impl rustc_span::source_map::FileLoader for IpcFileLoader {
3232
fn file_exists(&self, path: &Path) -> bool {
3333
self.0.file_exists(path.to_owned()).wait().unwrap()
3434
}

rls-rustc/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ impl Callbacks for ShimCalls {
135135
src_path,
136136
disambiguator: sess.local_crate_disambiguator().to_fingerprint().as_value(),
137137
edition: match sess.edition() {
138-
syntax::edition::Edition::Edition2015 => Edition::Edition2015,
139-
syntax::edition::Edition::Edition2018 => Edition::Edition2018,
138+
rustc_span::edition::Edition::Edition2015 => Edition::Edition2015,
139+
rustc_span::edition::Edition::Edition2018 => Edition::Edition2018,
140140
},
141141
};
142142

rls/src/actions/diagnostics.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use lsp_types::{
1515
};
1616
use rls_span::compiler::DiagnosticSpan;
1717
use serde_derive::Deserialize;
18-
use serde_json;
1918
use url::Url;
2019

2120
pub use lsp_types::Diagnostic;
@@ -598,12 +597,6 @@ help: consider borrowing here: `&string`"#,
598597
assert!(messages[0].1.is_empty(), "{:?}", messages[0].1);
599598
}
600599

601-
/// ```
602-
/// fn main() {
603-
/// let mut out = String::new();
604-
/// write!(out, "{}", 123);
605-
/// }
606-
/// ```
607600
#[test]
608601
fn macro_error_no_trait() {
609602
let diag = parse_compiler_message(

rls/src/actions/format.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use log::debug;
1313
use lsp_types::{Position, Range, TextEdit};
1414
use rand::{distributions, thread_rng, Rng};
1515
use rustfmt_nightly::{Config, Input, ModifiedLines, NewlineStyle, Session};
16-
use serde_json;
1716

1817
/// Specifies which `rustfmt` to use.
1918
#[derive(Clone)]

rls/src/actions/hover.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use std::path::{Path, PathBuf};
22

3-
use home;
43
use log::*;
5-
use racer;
64
use rls_analysis::{Def, DefKind};
75
use rls_span::{Column, Range, Row, Span, ZeroIndexed};
86
use rls_vfs::{self as vfs, Vfs};

rls/src/actions/requests.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ use std::sync::atomic::Ordering;
77
use itertools::Itertools;
88
use jsonrpc_core::types::ErrorCode;
99
use log::{debug, trace, warn};
10-
use racer;
1110
use rls_analysis::SymbolQuery;
1211
use rls_data as data;
1312
use rls_span as span;
1413
use rls_vfs::FileContents;
1514
use rustfmt_nightly::{Edition as RustfmtEdition, FileLines, FileName, Range as RustfmtRange};
1615
use serde_derive::{Deserialize, Serialize};
17-
use serde_json;
1816
use url::Url;
1917

2018
use crate::actions::hover;
@@ -269,7 +267,7 @@ impl RequestAction for Completion {
269267
.map(|comp| {
270268
let mut item = completion_item_from_racer_match(&comp);
271269
if is_use_stmt && comp.mtype.is_function() {
272-
item.insert_text = Some(comp.matchstr.to_string());
270+
item.insert_text = Some(comp.matchstr);
273271
} else if code_completion_has_snippet_support {
274272
let snippet = racer::snippet_for_match(&comp, &session);
275273
if !snippet.is_empty() {

rls/src/actions/work_pool.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::server::DEFAULT_REQUEST_TIMEOUT;
22
use lazy_static::lazy_static;
33
use log::{info, warn};
4-
use rayon;
54
use std::sync::{mpsc, Mutex};
65
use std::time::{Duration, Instant};
76
use std::{fmt, panic};

rls/src/build/cargo.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use cargo::util::{
2323
use log::{debug, trace, warn};
2424
use rls_data::Analysis;
2525
use rls_vfs::Vfs;
26-
use serde_json;
2726

2827
use crate::actions::progress::ProgressUpdate;
2928
use crate::build::cargo_plan::CargoPlan;

rls/src/build/cargo_plan.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use cargo::core::compiler::{CompileKind, CompileMode, Context, Unit};
2323
use cargo::core::profiles::Profile;
2424
use cargo::core::{PackageId, Target, TargetKind};
2525
use cargo::util::ProcessBuilder;
26-
use cargo_metadata;
2726
use log::{error, trace};
2827

2928
use crate::build::plan::{BuildGraph, BuildKey, JobQueue, WorkStatus};

rls/src/build/external.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl Invocation {
229229
Invocation {
230230
deps: raw.deps.to_owned(),
231231
outputs: raw.outputs.to_owned(),
232-
links: raw.links.to_owned(),
232+
links: raw.links,
233233
src_path: guess_rustc_src_path(build_dir, &command),
234234
command,
235235
}

0 commit comments

Comments
 (0)