193193# previous `progress` key based specification, we create a custom
194194# string type that has `Progress` attached to it. This is used as the
195195# third argument `message` of `Logging.handle_message`.
196- struct ProgressString <: AbstractString
196+ struct ProgressString
197197 progress:: Progress
198198end
199199
@@ -208,13 +208,14 @@ Base.string(str::ProgressString) = str.progress.name
208208
209209Base. print (io:: IO , str:: ProgressString ) = print (io, string (str))
210210Base. convert (:: Type{ProgressString} , str:: ProgressString ) = str
211- Base. convert (:: Type{T} , str:: ProgressString ) where {T<: AbstractString } =
212- convert (T, str. progress. name)
213211
214- # Define `cmp` to make `==` etc. work
215- Base. cmp (a:: AbstractString , b:: ProgressString ) = cmp (a, string (b))
216- Base. cmp (a:: ProgressString , b:: AbstractString ) = cmp (string (a), b)
217- Base. cmp (a:: ProgressString , b:: ProgressString ) = cmp (string (a), string (b))
212+ # Define `isless` and `==` to make comparisons work
213+ Base. isless (a:: AbstractString , b:: ProgressString ) = isless (a, string (b))
214+ Base. isless (a:: ProgressString , b:: AbstractString ) = isless (string (a), b)
215+ Base. isless (a:: ProgressString , b:: ProgressString ) = isless (string (a), string (b))
216+ Base.:(== )(a:: AbstractString , b:: ProgressString ) = a == string (b)
217+ Base.:(== )(a:: ProgressString , b:: AbstractString ) = string (a) == b
218+ Base.:(== )(a:: ProgressString , b:: ProgressString ) = string (a) == string (b)
218219
219220# Avoid using `show(::IO, ::AbstractString)` which expects
220221# `Base.print_quoted` to work.
0 commit comments