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

Commit

Permalink
Merge pull request #1671 from Xanewok/lints
Browse files Browse the repository at this point in the history
Apply clippy lints
  • Loading branch information
Xanewok committed May 7, 2020
2 parents 1256334 + 577ab7d commit 2f17cf7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions rls-rustc/src/lib.rs
Expand Up @@ -120,7 +120,6 @@ impl Callbacks for ShimCalls {

let sess = compiler.session();
let input = compiler.input();
let crate_name = queries.crate_name().unwrap().peek().clone();

let cwd = &sess.working_dir.0;

Expand All @@ -131,7 +130,7 @@ impl Callbacks for ShimCalls {
.and_then(|path| src_path(Some(cwd), path));

let krate = Crate {
name: crate_name.to_owned(),
name: queries.crate_name().unwrap().peek().to_owned(),
src_path,
disambiguator: sess.local_crate_disambiguator().to_fingerprint().as_value(),
edition: match sess.edition() {
Expand Down
3 changes: 2 additions & 1 deletion rls/src/actions/mod.rs
Expand Up @@ -491,12 +491,13 @@ fn find_word_at_pos(line: &str, pos: Column) -> (Column, Column) {
.map(|(i, _)| i + 1)
.unwrap_or(0) as u32;

#[allow(clippy::filter_next)]
let end = line
.chars()
.enumerate()
.skip(col)
.filter(|&(_, c)| !is_ident_char(c))
.nth(0)
.next()
.map(|(i, _)| i)
.unwrap_or(col) as u32;

Expand Down
4 changes: 3 additions & 1 deletion rls/src/actions/post_build.rs
Expand Up @@ -291,7 +291,9 @@ impl RefUnwindSafe for AnalysisQueue {}

impl Drop for AnalysisQueue {
fn drop(&mut self) {
let _ = self.queue.lock().map(|mut q| q.push(QueuedJob::Terminate));
if let Ok(mut queue) = self.queue.lock() {
queue.push(QueuedJob::Terminate);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion rls/src/build/plan.rs
Expand Up @@ -176,7 +176,7 @@ impl JobQueue {
&internals.vfs,
&args,
job.get_envs(),
job.get_cwd().or_else(|| cwd.as_ref().map(|p| &**p)),
job.get_cwd().or_else(|| cwd.as_deref()),
&build_dir,
Arc::clone(&internals.config),
&internals.env_lock.as_facade(),
Expand Down

0 comments on commit 2f17cf7

Please sign in to comment.