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

Commit 743973c

Browse files
committed
fix clippy warnings
1 parent bf1d8f9 commit 743973c

File tree

17 files changed

+8
-34
lines changed

17 files changed

+8
-34
lines changed

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
}

rls/src/build/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
264264
.and_then(|path| src_path(Some(cwd), path));
265265

266266
let krate = Crate {
267-
name: crate_name.to_owned(),
267+
name: crate_name,
268268
src_path,
269269
disambiguator: sess.local_crate_disambiguator().to_fingerprint().as_value(),
270270
edition: match sess.edition() {

rls/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl Config {
253253
deprecated.push(snake_case.clone());
254254
}
255255

256-
Some((snake_case, JsonValue(v.to_owned().clone())))
256+
Some((snake_case, JsonValue(v.to_owned())))
257257
} else {
258258
None
259259
}

0 commit comments

Comments
 (0)