redundant_closure

This commit is contained in:
Johann Hemmann 2024-01-19 16:37:08 +01:00
parent 3cf1358eb8
commit 5a62a0db46
4 changed files with 6 additions and 10 deletions

View file

@ -308,7 +308,7 @@ impl SourceToDefCtx<'_, '_> {
pub(super) fn type_param_to_def(&mut self, src: InFile<ast::TypeParam>) -> Option<TypeParamId> {
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
let dyn_map = self.cache_for(container, src.file_id);
dyn_map[keys::TYPE_PARAM].get(&src.value).copied().map(|it| TypeParamId::from_unchecked(it))
dyn_map[keys::TYPE_PARAM].get(&src.value).copied().map(TypeParamId::from_unchecked)
}
pub(super) fn lifetime_param_to_def(
@ -326,10 +326,7 @@ impl SourceToDefCtx<'_, '_> {
) -> Option<ConstParamId> {
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
let dyn_map = self.cache_for(container, src.file_id);
dyn_map[keys::CONST_PARAM]
.get(&src.value)
.copied()
.map(|it| ConstParamId::from_unchecked(it))
dyn_map[keys::CONST_PARAM].get(&src.value).copied().map(ConstParamId::from_unchecked)
}
pub(super) fn generic_param_to_def(