Drive by lints
This commit is contained in:
parent
5063274959
commit
1808175f98
@ -19,7 +19,7 @@ pub struct AstEditor<N: AstNode> {
|
||||
}
|
||||
|
||||
impl<N: AstNode> AstEditor<N> {
|
||||
pub fn new(node: N) -> AstEditor<N>
|
||||
pub fn new(node: N) -> Self
|
||||
where
|
||||
N: Clone,
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ pub(crate) fn fill_match_arms(mut ctx: AssistCtx<impl HirDatabase>) -> Option<As
|
||||
|
||||
ctx.add_action(AssistId("fill_match_arms"), "fill match arms", |edit| {
|
||||
let variants = variant_list.variants();
|
||||
let arms = variants.into_iter().filter_map(build_pat).map(|pat| {
|
||||
let arms = variants.filter_map(build_pat).map(|pat| {
|
||||
AstBuilder::<ast::MatchArm>::from_pieces(
|
||||
iter::once(pat),
|
||||
&AstBuilder::<ast::Expr>::unit(),
|
||||
|
@ -749,7 +749,7 @@ pub fn data(self, db: &impl HirDatabase) -> Arc<ConstData> {
|
||||
db.const_data(self)
|
||||
}
|
||||
|
||||
pub fn name(&self, db: &impl HirDatabase) -> Option<Name> {
|
||||
pub fn name(self, db: &impl HirDatabase) -> Option<Name> {
|
||||
self.data(db).name().cloned()
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ fn from_source(db: &(impl DefDatabase + AstDatabase), src: Source<Self::Ast>) ->
|
||||
.fields()
|
||||
.into_iter()
|
||||
.flat_map(|it| it.iter())
|
||||
.map(|(id, _)| StructField { parent: variant_def.clone(), id })
|
||||
.map(|(id, _)| StructField { parent: variant_def, id })
|
||||
.find(|f| f.source(db) == src)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user