mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Merge #138
138: Fix some clippy lints r=matklad a=alanhdu
I went ahead and fixed all the clippy lints (there were a couple I thought would be better unfixed and added `cfg` statements to allow them) and also re-enabled clippy and rustfmt in CI.
They were disabled with `no time to explain, disable clippy checks`, so hopefully this won't go against whatever the reason at the time was 😆.
One question about the CI though: right now, it's an allowed failure that runs against the latest nightly each time. Would it be better to pin it to a specific nightly (or use the `beta` versions) to lower the churn?
Co-authored-by: Alan Du <alanhdu@gmail.com>
This commit is contained in:
commit
27694abd94
26 changed files with 67 additions and 68 deletions
|
@ -87,12 +87,18 @@ salsa::query_group! {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Eq)]
|
||||
#[derive(Default, Debug, Eq)]
|
||||
pub(crate) struct FileSet {
|
||||
pub(crate) files: FxHashSet<FileId>,
|
||||
pub(crate) resolver: FileResolverImp,
|
||||
}
|
||||
|
||||
impl PartialEq for FileSet {
|
||||
fn eq(&self, other: &FileSet) -> bool {
|
||||
self.files == other.files && self.resolver == other.resolver
|
||||
}
|
||||
}
|
||||
|
||||
impl Hash for FileSet {
|
||||
fn hash<H: Hasher>(&self, hasher: &mut H) {
|
||||
let mut files = self.files.iter().cloned().collect::<Vec<_>>();
|
||||
|
|
|
@ -22,7 +22,7 @@ impl ModuleDescriptor {
|
|||
}
|
||||
}
|
||||
|
||||
fn modules<'a>(root: ast::Root<'a>) -> impl Iterator<Item = (SmolStr, ast::Module<'a>)> {
|
||||
fn modules(root: ast::Root<'_>) -> impl Iterator<Item = (SmolStr, ast::Module<'_>)> {
|
||||
root.modules().filter_map(|module| {
|
||||
let name = module.name()?.text();
|
||||
if !module.has_semi() {
|
||||
|
@ -184,8 +184,7 @@ impl Link {
|
|||
root: ast::Root<'a>,
|
||||
) -> ast::Module<'a> {
|
||||
modules(root)
|
||||
.filter(|(name, _)| name == &tree.link(self).name)
|
||||
.next()
|
||||
.find(|(name, _)| name == &tree.link(self).name)
|
||||
.unwrap()
|
||||
.1
|
||||
}
|
||||
|
|
|
@ -426,12 +426,12 @@ impl AnalysisImpl {
|
|||
.text()
|
||||
.slice(range_search)
|
||||
.to_string()
|
||||
.matches(",")
|
||||
.matches(',')
|
||||
.count();
|
||||
|
||||
// If we have a method call eat the first param since it's just self.
|
||||
if has_self {
|
||||
commas = commas + 1;
|
||||
commas += 1;
|
||||
}
|
||||
|
||||
current_parameter = Some(commas);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue