File tree Expand file tree Collapse file tree 2 files changed +100
-163
lines changed
Expand file tree Collapse file tree 2 files changed +100
-163
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ impl Builder {
3030 }
3131
3232 // Formats type and returns formatted code.
33- fn formatType(self, mut t: &ast::Type ): str {
33+ fn formatType(self, mut t: &ast::Expr ): str {
3434 self.fmt.buf.Clear()
3535 self.fmt.formatType(t)
3636 ret strings::TrimSpace(self.fmt.buf.Str())
@@ -208,13 +208,10 @@ impl Builder {
208208 fn analysisImpl(self, mut ast: &ast::Impl) {
209209 // Destination type should be simple identifier type.
210210 // Otherwise we have to assume this implementation is not suitable to analysis.
211- match type ast.Dest.Kind {
212- | &ast::IdentType:
213- break
214- |:
211+ dest, _ := ast.Dest.Kind.(&ast::IdentExpr)
212+ if dest == nil {
215213 ret
216214 }
217- dest := ast.Dest.Kind.(&ast::IdentType)
218215 // Destination is not public. Skip.
219216 if !isPub(dest.Ident) {
220217 ret
@@ -224,7 +221,7 @@ impl Builder {
224221 // the trait type declaration for implementation. If identifier type is
225222 // not public, no need for documentation.
226223 if ast.IsTraitImpl() {
227- name, isName := ast.Base.Kind.(&ast::IdentType )
224+ name, isName := ast.Base.Kind.(&ast::IdentExpr )
228225 if isName && !isPub(name.Ident) {
229226 ret
230227 }
You can’t perform that action at this time.
0 commit comments