Skip to content

Commit 39ba498

Browse files
authored
Merge pull request rust-lang#18793 from ChayimFriedman2/fixup
minor: Remove unneeded conversions
2 parents 4a1c7d1 + b4ad30d commit 39ba498

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/tools/rust-analyzer/crates/hir/src/semantics.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -246,59 +246,59 @@ impl<DB: HirDatabase> Semantics<'_, DB> {
246246
}
247247

248248
pub fn to_adt_def(&self, a: &ast::Adt) -> Option<Adt> {
249-
self.imp.to_def(a).map(Adt::from)
249+
self.imp.to_def(a)
250250
}
251251

252252
pub fn to_const_def(&self, c: &ast::Const) -> Option<Const> {
253-
self.imp.to_def(c).map(Const::from)
253+
self.imp.to_def(c)
254254
}
255255

256256
pub fn to_enum_def(&self, e: &ast::Enum) -> Option<Enum> {
257-
self.imp.to_def(e).map(Enum::from)
257+
self.imp.to_def(e)
258258
}
259259

260260
pub fn to_enum_variant_def(&self, v: &ast::Variant) -> Option<Variant> {
261-
self.imp.to_def(v).map(Variant::from)
261+
self.imp.to_def(v)
262262
}
263263

264264
pub fn to_fn_def(&self, f: &ast::Fn) -> Option<Function> {
265-
self.imp.to_def(f).map(Function::from)
265+
self.imp.to_def(f)
266266
}
267267

268268
pub fn to_impl_def(&self, i: &ast::Impl) -> Option<Impl> {
269-
self.imp.to_def(i).map(Impl::from)
269+
self.imp.to_def(i)
270270
}
271271

272272
pub fn to_macro_def(&self, m: &ast::Macro) -> Option<Macro> {
273-
self.imp.to_def(m).map(Macro::from)
273+
self.imp.to_def(m)
274274
}
275275

276276
pub fn to_module_def(&self, m: &ast::Module) -> Option<Module> {
277-
self.imp.to_def(m).map(Module::from)
277+
self.imp.to_def(m)
278278
}
279279

280280
pub fn to_static_def(&self, s: &ast::Static) -> Option<Static> {
281-
self.imp.to_def(s).map(Static::from)
281+
self.imp.to_def(s)
282282
}
283283

284284
pub fn to_struct_def(&self, s: &ast::Struct) -> Option<Struct> {
285-
self.imp.to_def(s).map(Struct::from)
285+
self.imp.to_def(s)
286286
}
287287

288288
pub fn to_trait_alias_def(&self, t: &ast::TraitAlias) -> Option<TraitAlias> {
289-
self.imp.to_def(t).map(TraitAlias::from)
289+
self.imp.to_def(t)
290290
}
291291

292292
pub fn to_trait_def(&self, t: &ast::Trait) -> Option<Trait> {
293-
self.imp.to_def(t).map(Trait::from)
293+
self.imp.to_def(t)
294294
}
295295

296296
pub fn to_type_alias_def(&self, t: &ast::TypeAlias) -> Option<TypeAlias> {
297-
self.imp.to_def(t).map(TypeAlias::from)
297+
self.imp.to_def(t)
298298
}
299299

300300
pub fn to_union_def(&self, u: &ast::Union) -> Option<Union> {
301-
self.imp.to_def(u).map(Union::from)
301+
self.imp.to_def(u)
302302
}
303303
}
304304

0 commit comments

Comments
 (0)