Minor cleanup

This commit is contained in:
Victor Zverovich 2018-09-13 07:37:20 -07:00
parent 1fb1c4c912
commit 66381e308d
2 changed files with 6 additions and 5 deletions

View File

@ -3731,6 +3731,7 @@ FMT_END_NAMESPACE
**Example**::
#define FMT_STRING_ALIAS 1
#include <fmt/format.h>
// A compile-time error because 'd' is an invalid specifier for strings.
std::string s = format(fmt("{:d}"), "foo");

View File

@ -113,8 +113,9 @@ class Translator(nodes.NodeVisitor):
for i, entry in enumerate(row):
text = entry[0][0] if len(entry) > 0 else ''
if i != 0:
self.write(' ')
self.write('|')
self.write('{:{}}'.format(text, widths[i]))
self.write('\n')
def visit_table(self, node):
table = node.children[0]
@ -122,14 +123,13 @@ class Translator(nodes.NodeVisitor):
thead = table[-2]
tbody = table[-1]
widths = [int(cs['colwidth']) for cs in colspecs]
sep = ' '.join(['-' * w for w in widths])
self.write(sep)
sep = '|'.join(['-' * w for w in widths]) + '\n'
self.write('\n\n')
self.write_row(thead[0], widths)
self.write(sep)
for row in tbody:
self.write_row(row, widths)
self.write(sep)
raise nodes.StopTraversal
raise nodes.SkipChildren
def depart_table(self, node):
pass