Skip to content

Commit eb9d650

Browse files
committed
fix some minor problems
thanks @MichaelHatherly for review :]
1 parent 534c2d2 commit eb9d650

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/utilities.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,16 @@ function printmethod_format(buffer::IOBuffer, binding::String, args::Vector{Stri
190190
if method_length_over_limit(
191191
length(binding) +
192192
1 +
193-
sum(length.(args)) +
194-
sum(length.(kws)) +
193+
sum(length, args; init = 0) +
194+
sum(length, kws; init = 0) +
195195
2*max(0, length(args)-1) +
196196
2*length(kws) +
197197
1 +
198198
length(return_type))
199199

200200
sep_delim = "\n"
201201
paren_delim = "\n"
202-
indent = " "
202+
indent = " "
203203
end
204204

205205
print(buffer, binding)
@@ -356,7 +356,7 @@ function printmethod(buffer::IOBuffer, binding::Docs.Binding, func, method::Meth
356356
type = "::$t"
357357
end
358358

359-
string(arg)*type*suffix
359+
"$arg$type$suffix"
360360
end
361361

362362
rt = Base.return_types(func, typesig)

test/tests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ end
307307
@test occursin("\n```julia\n", str)
308308
if VERSION > v"1.3.0"
309309
@test occursin("\nk_5(::Type{T<:Number}, x::String) -> String\n", str)
310-
@test occursin("\nk_5(\n ::Type{T<:Number},\n x::String,\n func::Union{Nothing, Function}\n) -> String\n", str)
310+
@test occursin("\nk_5(\n ::Type{T<:Number},\n x::String,\n func::Union{Nothing, Function}\n) -> String\n", str)
311311
@test occursin("\n```\n", str)
312312
else
313313
# TODO: remove this test when julia 1.0.0 support is dropped.
@@ -343,11 +343,11 @@ end
343343
str = String(take!(buf))
344344
@test occursin("\n```julia\n", str)
345345
if VERSION >= v"1.6" && VERSION < v"1.7"
346-
@test occursin("\nk_7(\n x::Union{Nothing, T} where T<:Integer\n) -> Union{Nothing, Integer}\n", str)
347-
@test occursin("\nk_7(\n x::Union{Nothing, T} where T<:Integer,\n y::Integer\n) -> Union{Nothing, Integer}\n", str)
346+
@test occursin("\nk_7(\n x::Union{Nothing, T} where T<:Integer\n) -> Union{Nothing, Integer}\n", str)
347+
@test occursin("\nk_7(\n x::Union{Nothing, T} where T<:Integer,\n y::Integer\n) -> Union{Nothing, Integer}\n", str)
348348
else
349-
@test occursin("\nk_7(\n x::Union{Nothing, T} where T<:Integer\n) -> Union{Nothing, T} where T<:Integer\n", str)
350-
@test occursin("\nk_7(\n x::Union{Nothing, T} where T<:Integer,\n y::Integer\n) -> Union{Nothing, T} where T<:Integer\n", str)
349+
@test occursin("\nk_7(\n x::Union{Nothing, T} where T<:Integer\n) -> Union{Nothing, T} where T<:Integer\n", str)
350+
@test occursin("\nk_7(\n x::Union{Nothing, T} where T<:Integer,\n y::Integer\n) -> Union{Nothing, T} where T<:Integer\n", str)
351351
end
352352
@test occursin("\n```\n", str)
353353

0 commit comments

Comments
 (0)