summaryrefslogtreecommitdiff
path: root/src/ast/dump.cpp
diff options
context:
space:
mode:
authorJohn Hodge (bugs) <tpg@mutabah.net>2017-06-04 21:23:24 +0800
committerJohn Hodge (bugs) <tpg@mutabah.net>2017-06-04 21:23:24 +0800
commit83dbb728f62306d2e43b2688dd0f2d320fd5b038 (patch)
treea064267bdf8d0455ed725140abfcbed3e04b2d4a /src/ast/dump.cpp
parent0b9fd0014c8f32ecf299dae2ad1811dfb484af46 (diff)
parentf19c75571c48588fb3816e8eb5b96f03474fbdf5 (diff)
downloadmrust-83dbb728f62306d2e43b2688dd0f2d320fd5b038.tar.gz
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'src/ast/dump.cpp')
-rw-r--r--src/ast/dump.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/ast/dump.cpp b/src/ast/dump.cpp
index a6c298b0..0d77054c 100644
--- a/src/ast/dump.cpp
+++ b/src/ast/dump.cpp
@@ -991,22 +991,18 @@ void RustPrinter::handle_struct(const AST::Struct& s)
print_params(s.params());
TU_MATCH(AST::StructData, (s.m_data), (e),
+ (Unit,
+ m_os << " /* unit-like */\n";
+ print_bounds(s.params());
+ m_os << indent() << ";\n";
+ ),
(Tuple,
- if( e.ents.size() == 0 )
- {
- m_os << " /* unit-like */\n";
- print_bounds(s.params());
- m_os << indent() << ";\n";
- }
- else
- {
- m_os << "(";
- for( const auto& i : e.ents )
- m_os << i.m_type << ", ";
- m_os << ")\n";
- print_bounds(s.params());
- m_os << indent() << ";\n";
- }
+ m_os << "(";
+ for( const auto& i : e.ents )
+ m_os << i.m_type << ", ";
+ m_os << ")\n";
+ print_bounds(s.params());
+ m_os << indent() << ";\n";
),
(Struct,
m_os << "\n";