Skip to content

Commit a8737d7

Browse files
mcabbottlassepe
andauthored
Use LazyString in depwarn (#2400)
* Update macro.jl * Update deprecations.jl * Update Project.toml * Update src/layers/macro.jl Co-authored-by: Lasse Peters <lasse.peters@mailbox.org> * Update src/deprecations.jl --------- Co-authored-by: Lasse Peters <lasse.peters@mailbox.org>
1 parent 85d953a commit a8737d7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Flux"
22
uuid = "587475ba-b771-5e3f-ad9e-33799f191a9c"
3-
version = "0.14.13"
3+
version = "0.14.14"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/deprecations.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ end
196196
# Greek-letter keywords deprecated in Flux 0.13
197197
# Arguments (old => new, :function, "β" => "beta")
198198
function _greek_ascii_depwarn(βbeta::Pair, func = :loss, names = "" => "")
199-
Base.depwarn("""function $func no longer accepts greek-letter keyword $(names.first)
200-
please use ascii $(names.second) instead""", func)
199+
Base.depwarn(LazyString("function ", func, " no longer accepts greek-letter keyword ", names.first, """
200+
please use ascii """, names.second, " instead"), func)
201201
βbeta.first
202202
end
203203
_greek_ascii_depwarn(βbeta::Pair{Nothing}, _...) = βbeta.second

src/layers/macro.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ end
8989

9090
function _check_new_macro(x::T) where T
9191
Functors.isleaf(x) && return
92-
Base.depwarn("This type should probably now use `Flux.@layer` instead of `@functor`: $T", Symbol("@functor"))
92+
Base.depwarn(LazyString("This type should probably now use `Flux.@layer` instead of `@functor`: ", T), Symbol("@functor"))
9393
end
9494
_check_new_macro(::Tuple) = nothing # defined by Functors.jl, not by users
9595
_check_new_macro(::NamedTuple) = nothing

0 commit comments

Comments
 (0)