Skip to content

Commit 7c169bc

Browse files
committed
format(TypeFields): reduce code duplication
1 parent 0dbe816 commit 7c169bc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/abbreviations.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,9 @@ function format(abbrv::TypeFields, buf, doc)
100100
if !isempty(fields)
101101
println(buf)
102102
for field in fields
103-
if abbrv.types
104-
println(buf, " - `", field, "::", fieldtype(object, field), "`")
105-
else
106-
println(buf, " - `", field, "`")
107-
end
103+
print(buf, " - `", field)
104+
abbrv.types && print(buf, "::", fieldtype(object, field))
105+
println(buf, "`")
108106
# Print the field docs if they exist and aren't a `doc"..."` docstring.
109107
if haskey(docs, field) && isa(docs[field], AbstractString)
110108
println(buf)

0 commit comments

Comments
 (0)