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

Commit 7ea0866

Browse files
committed
Clean up PR according to comments in #1395
1 parent a8f5e7c commit 7ea0866

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

rls-analysis/examples/print-crate-id.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ extern crate env_logger;
22
extern crate rls_analysis;
33

44
use rls_analysis::{AnalysisHost, AnalysisLoader, SearchDirectory};
5-
use std::collections::HashMap;
65
use std::env;
76
use std::path::{Path, PathBuf};
87

@@ -43,7 +42,7 @@ fn main() {
4342
std::process::exit(1);
4443
}
4544
let loader = Loader::new(PathBuf::from(env::args().nth(1).unwrap()));
46-
let crates = rls_analysis::read_analysis_from_files(&loader, HashMap::new(), &[]);
45+
let crates = rls_analysis::read_analysis_from_files(&loader, Default::default(), &[]);
4746

4847
for krate in &crates {
4948
println!("Crate {:?} data version {:?}", krate.id, krate.analysis.version);

rls-analysis/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl<L: AnalysisLoader> AnalysisHost<L> {
239239
}
240240

241241
pub fn get_def(&self, id: Id) -> AResult<Def> {
242-
self.with_analysis(|a| a.with_defs(id, std::clone::Clone::clone))
242+
self.with_analysis(|a| a.with_defs(id, Clone::clone))
243243
}
244244

245245
pub fn goto_def(&self, span: &Span) -> AResult<Span> {
@@ -434,7 +434,7 @@ impl<L: AnalysisLoader> AnalysisHost<L> {
434434

435435
/// Search for a symbol name, returning a list of def_ids for that name.
436436
pub fn search_for_id(&self, name: &str) -> AResult<Vec<Id>> {
437-
self.with_analysis(|a| Some(a.with_def_names(name, std::clone::Clone::clone)))
437+
self.with_analysis(|a| Some(a.with_def_names(name, Clone::clone)))
438438
}
439439

440440
pub fn symbols(&self, file_name: &Path) -> AResult<Vec<SymbolResult>> {

rls-analysis/src/raw.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ impl Crate {
5050

5151
/// Reads raw analysis data for non-blacklisted crates from files in directories
5252
/// pointed by `loader`.
53-
pub fn read_analysis_from_files<L: AnalysisLoader, S: std::hash::BuildHasher + Default>(
53+
pub fn read_analysis_from_files<L: AnalysisLoader>(
5454
loader: &L,
55-
crate_timestamps: HashMap<PathBuf, SystemTime, S>,
55+
crate_timestamps: HashMap<PathBuf, SystemTime>,
5656
crate_blacklist: Blacklist,
5757
) -> Vec<Crate> {
5858
let mut result = vec![];

0 commit comments

Comments
 (0)