feat: add generate_mut_trait_impl assist

This commit is contained in:
Young-Flash 2023-11-04 11:32:15 +08:00
parent 69432287cb
commit 8d8d12120d
4 changed files with 236 additions and 0 deletions

View file

@ -852,6 +852,10 @@ pub fn self_param() -> ast::SelfParam {
ast_from_text("fn f(&self) { }")
}
pub fn mut_self_param() -> ast::SelfParam {
ast_from_text("fn f(&mut self) { }")
}
pub fn ret_type(ty: ast::Type) -> ast::RetType {
ast_from_text(&format!("fn f() -> {ty} {{ }}"))
}