mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
remove minor code duplication
This commit is contained in:
parent
9383ae720b
commit
4ca8331933
2 changed files with 16 additions and 20 deletions
|
@ -197,13 +197,13 @@ impl From<crate::adt::AdtDef> for GenericDef {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait HasGenericParams {
|
||||
pub trait HasGenericParams: Copy {
|
||||
fn generic_params(self, db: &impl DefDatabase) -> Arc<GenericParams>;
|
||||
}
|
||||
|
||||
impl<T> HasGenericParams for T
|
||||
where
|
||||
T: Into<GenericDef>,
|
||||
T: Into<GenericDef> + Copy,
|
||||
{
|
||||
fn generic_params(self, db: &impl DefDatabase) -> Arc<GenericParams> {
|
||||
db.generic_params(self.into())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue