mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Clippy trivially_copy_pass_by_ref
This commit is contained in:
parent
ec6f71576a
commit
001e34e6e3
11 changed files with 30 additions and 30 deletions
|
@ -34,8 +34,8 @@ impl AdtDef {
|
|||
}
|
||||
|
||||
impl Struct {
|
||||
pub(crate) fn variant_data(&self, db: &impl DefDatabase) -> Arc<VariantData> {
|
||||
db.struct_data(*self).variant_data.clone()
|
||||
pub(crate) fn variant_data(self, db: &impl DefDatabase) -> Arc<VariantData> {
|
||||
db.struct_data(self).variant_data.clone()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ fn variants(enum_def: &ast::EnumDef) -> impl Iterator<Item = &ast::EnumVariant>
|
|||
|
||||
impl EnumVariant {
|
||||
pub(crate) fn source_impl(
|
||||
&self,
|
||||
self,
|
||||
db: &(impl DefDatabase + AstDatabase),
|
||||
) -> Source<TreeArc<ast::EnumVariant>> {
|
||||
let src = self.parent.source(db);
|
||||
|
@ -81,7 +81,7 @@ impl EnumVariant {
|
|||
.to_owned();
|
||||
Source { file_id: src.file_id, ast }
|
||||
}
|
||||
pub(crate) fn variant_data(&self, db: &impl DefDatabase) -> Arc<VariantData> {
|
||||
pub(crate) fn variant_data(self, db: &impl DefDatabase) -> Arc<VariantData> {
|
||||
db.enum_data(self.parent).variants[self.id].variant_data.clone()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue