toplevel_ref_arg

This commit is contained in:
Johann Hemmann 2024-01-22 01:00:13 +01:00
parent 386d438e17
commit daa20725c5
3 changed files with 3 additions and 4 deletions

View file

@ -180,7 +180,6 @@ non_canonical_clone_impl = "allow"
non_canonical_partial_ord_impl = "allow" non_canonical_partial_ord_impl = "allow"
self_named_constructors = "allow" self_named_constructors = "allow"
too_many_arguments = "allow" too_many_arguments = "allow"
toplevel_ref_arg = "allow"
type_complexity = "allow" type_complexity = "allow"
unnecessary_cast = "allow" unnecessary_cast = "allow"
unnecessary_filter_map = "allow" unnecessary_filter_map = "allow"

View file

@ -396,7 +396,7 @@ impl Query {
pub fn search_dependencies( pub fn search_dependencies(
db: &dyn DefDatabase, db: &dyn DefDatabase,
krate: CrateId, krate: CrateId,
ref query: Query, query: &Query,
) -> FxHashSet<ItemInNs> { ) -> FxHashSet<ItemInNs> {
let _p = tracing::span!(tracing::Level::INFO, "search_dependencies", ?query).entered(); let _p = tracing::span!(tracing::Level::INFO, "search_dependencies", ?query).entered();
@ -516,7 +516,7 @@ mod tests {
}) })
.expect("could not find crate"); .expect("could not find crate");
let actual = search_dependencies(db.upcast(), krate, query) let actual = search_dependencies(db.upcast(), krate, &query)
.into_iter() .into_iter()
.filter_map(|dependency| { .filter_map(|dependency| {
let dependency_krate = dependency.krate(db.upcast())?; let dependency_krate = dependency.krate(db.upcast())?;

View file

@ -236,7 +236,7 @@ impl Crate {
query: import_map::Query, query: import_map::Query,
) -> impl Iterator<Item = Either<ModuleDef, Macro>> { ) -> impl Iterator<Item = Either<ModuleDef, Macro>> {
let _p = tracing::span!(tracing::Level::INFO, "query_external_importables"); let _p = tracing::span!(tracing::Level::INFO, "query_external_importables");
import_map::search_dependencies(db, self.into(), query).into_iter().map(|item| { import_map::search_dependencies(db, self.into(), &query).into_iter().map(|item| {
match ItemInNs::from(item) { match ItemInNs::from(item) {
ItemInNs::Types(mod_id) | ItemInNs::Values(mod_id) => Either::Left(mod_id), ItemInNs::Types(mod_id) | ItemInNs::Values(mod_id) => Either::Left(mod_id),
ItemInNs::Macros(mac_id) => Either::Right(mac_id), ItemInNs::Macros(mac_id) => Either::Right(mac_id),