@@ -270,7 +270,7 @@ mutable struct ProgressBar
270
270
paused:: Bool
271
271
task:: Union{Task,Nothing}
272
272
renderstatus:: Any
273
- extra_info:: Union{ Dict{String,<:Any},Nothing }
273
+ extra_info:: Dict{String,<:Any}
274
274
end
275
275
276
276
"""
286
286
RGBColor("(.05, 1, .05)"),
287
287
],
288
288
refresh_rate::Int = 60, # FPS of rendering
289
- extra_info::Union{ Dict{String,<:Any},Nothing} = nothing ,
289
+ extra_info::Dict{String,<:Any} = Dict{String,Any}() ,
290
290
)
291
291
292
292
Create a ProgressBar instance.
@@ -299,7 +299,7 @@ function ProgressBar(;
299
299
transient:: Bool = false ,
300
300
colors:: Union{String,Vector{RGBColor}} = [RGBColor (" (1, .05, .05)" ), RGBColor (" (.05, .05, 1)" ), RGBColor (" (.05, 1, .05)" )],
301
301
refresh_rate:: Int = 60 , # FPS of rendering
302
- extra_info:: Union{ Dict{String,<:Any},Nothing} = nothing ,
302
+ extra_info:: Dict{String,<:Any} = Dict {String,Any} () ,
303
303
)
304
304
columns = columns isa Symbol ? get_columns (columns) : columns
305
305
@@ -530,7 +530,7 @@ function render(pbar::ProgressBar)
530
530
end
531
531
532
532
# render the extra information
533
- if ! isnothing (pbar. extra_info)
533
+ if ! isempty (pbar. extra_info)
534
534
max_len = maximum (length .(keys (pbar. extra_info)))
535
535
for (k, v) in pbar. extra_info
536
536
write (iob, " \n " * k * " " ^ (max_len - length (k)) * " : " * string (v))
0 commit comments